diff --git a/.github/workflows/build-arch-emu.yaml b/.github/workflows/build-arch-emu.yaml index 371a2bd218..df764e28f8 100644 --- a/.github/workflows/build-arch-emu.yaml +++ b/.github/workflows/build-arch-emu.yaml @@ -14,6 +14,8 @@ env: BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX" # string with name of libraries to be checked CHECK_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX" + # string with name of libraries that are installed + INSTALLED_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX" jobs: @@ -73,8 +75,12 @@ jobs: gmp-dev mpfr-dev lapack-dev + python3 valgrind util-linux-misc + autoconf + automake + libtool - name: get CPU information (emulated) run: lscpu @@ -126,8 +132,12 @@ jobs: -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_STATIC_LIBS=OFF \ -DBLA_VENDOR="Generic" \ -DGRAPHBLAS_COMPACT=ON \ + -DSUITESPARSE_DEMOS=OFF \ + -DBUILD_TESTING=OFF \ .. echo "::endgroup::" echo "::group::Build $lib" @@ -136,14 +146,14 @@ jobs: done - name: check - timeout-minutes: 30 + timeout-minutes: 60 run: | IFS=':' CHECK_LIBS="${CHECK_LIBS}${{ matrix.extra-check-libs }}" for lib in ${CHECK_LIBS}; do printf "::group:: \033[0;32m==>\033[0m Checking library \033[0;32m${lib}\033[0m\n" cd ${GITHUB_WORKSPACE}/${lib} - make demos + make demos CMAKE_OPTIONS="-DSUITESPARSE_DEMOS=ON -DBUILD_TESTING=ON" echo "::endgroup::" done @@ -170,7 +180,7 @@ jobs: echo "::endgroup::" done - - name: build example + - name: build example using CMake run: | cd ${GITHUB_WORKSPACE}/Example/build printf "::group::\033[0;32m==>\033[0m Configuring example\n" @@ -187,9 +197,51 @@ jobs: ./my_demo printf "\033[1;35m C++ binary with shared libraries\033[0m\n" ./my_cxx_demo - printf "\033[1;35m C binary with statically linked libraries\033[0m\n" - ./my_demo_static - printf "\033[1;35m C++ binary with statically linked libraries\033[0m\n" - ./my_cxx_demo_static echo "::endgroup::" + - name: test Config + run: | + IFS=: + INSTALLED_LIBS="${INSTALLED_LIBS}${{ matrix.extra-build-libs }}" + for lib in ${INSTALLED_LIBS}; do + printf "::group:: \033[0;32m==>\033[0m Building with Config.cmake with library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/TestConfig/${lib} + cd build + cmake \ + -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/lib/cmake" \ + .. + cmake --build . --config Release + echo "::endgroup::" + done + + - name: build example using autotools + run: | + cd ${GITHUB_WORKSPACE}/Example + printf "::group::\033[0;32m==>\033[0m Configuring example\n" + autoreconf -fi + mkdir build-autotools + cd build-autotools + PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/lib/pkgconfig/ \ + ../configure --enable-shared --disable-static + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Building example\n" + make all + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Executing example\n" + printf "\033[1;35m C binary\033[0m\n" + LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/lib ./my_demo + printf "\033[1;35m C++ binary\033[0m\n" + LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/lib ./my_cxx_demo + echo "::endgroup::" + IFS=: + INSTALLED_LIBS="${INSTALLED_LIBS}${{ matrix.extra-build-libs }}" + for lib in ${INSTALLED_LIBS}; do + printf "::group:: \033[0;32m==>\033[0m Building test with library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/TestConfig/${lib} + autoreconf -fi + mkdir build-autotools && cd build-autotools + PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/lib/pkgconfig/ \ + ../configure --enable-shared --disable-static + make all + echo "::endgroup::" + done diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 135eed7740..6a8fa2583a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,6 +14,8 @@ env: BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX:GraphBLAS:LAGraph" # string with name of libraries to be checked CHECK_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX:GraphBLAS:LAGraph" + # string with name of libraries that are installed + INSTALLED_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX:GraphBLAS:LAGraph" jobs: @@ -158,6 +160,8 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \ -DBLA_VENDOR="OpenBLAS" \ + -DSUITESPARSE_DEMOS=OFF \ + -DBUILD_TESTING=OFF \ ${{ matrix.cuda-cmake-flags }} \ ${{ matrix.openmp-cmake-flags }} \ ${{ matrix.link-cmake-flags }} \ @@ -175,7 +179,7 @@ jobs: for lib in "${libs[@]}"; do printf "::group:: \033[0;32m==>\033[0m Checking library \033[0;32m${lib}\033[0m\n" cd ${GITHUB_WORKSPACE}/${lib} - make demos + make demos CMAKE_OPTIONS="-DSUITESPARSE_DEMOS=ON -DBUILD_TESTING=ON" echo "::endgroup::" done @@ -201,7 +205,7 @@ jobs: echo "::endgroup::" done - - name: build example + - name: build example using CMake run: | cd ${GITHUB_WORKSPACE}/Example/build printf "::group::\033[0;32m==>\033[0m Configuring example\n" @@ -228,6 +232,56 @@ jobs: ./my_cxx_demo_static echo "::endgroup::" + - name: test Config + run: | + IFS=':' read -r -a libs <<< "${INSTALLED_LIBS}" + for lib in "${libs[@]}"; do + printf "::group:: \033[0;32m==>\033[0m Building with Config.cmake with library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/TestConfig/${lib} + cd build + cmake \ + -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/lib/cmake" \ + .. + cmake --build . --config Release + echo "::endgroup::" + done + + - name: build example using autotools + run: | + cd ${GITHUB_WORKSPACE}/Example + printf "::group::\033[0;32m==>\033[0m Configuring example\n" + autoreconf -fi + mkdir build-autotools + cd build-autotools + if [ "${{ matrix.link }}" = static ]; then + _extra_config_flags="--enable-static --disable-shared" + else + _extra_config_flags="--enable-shared --disable-static" + fi + PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/lib/pkgconfig/ \ + ../configure ${_extra_config_flags} + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Building example\n" + make all + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Executing example\n" + printf "\033[1;35m C binary\033[0m\n" + LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/lib ./my_demo + printf "\033[1;35m C++ binary\033[0m\n" + LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/lib ./my_cxx_demo + echo "::endgroup::" + IFS=':' read -r -a libs <<< "${INSTALLED_LIBS}" + for lib in "${libs[@]}"; do + printf "::group:: \033[0;32m==>\033[0m Building test with library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/TestConfig/${lib} + autoreconf -fi + mkdir build-autotools && cd build-autotools + PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/lib/pkgconfig/ \ + ../configure ${_extra_config_flags} + make all + echo "::endgroup::" + done + mingw: # For available GitHub-hosted runners, see: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners @@ -337,6 +391,8 @@ jobs: -DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \ -DBLA_VENDOR="OpenBLAS" \ -DPython_EXECUTABLE="$(which python)" \ + -DSUITESPARSE_DEMOS=OFF \ + -DBUILD_TESTING=OFF \ .. echo "::endgroup::" echo "::group::Build $lib" @@ -356,7 +412,7 @@ jobs: printf "::group:: \033[0;32m==>\033[0m Checking library \033[0;32m${lib}\033[0m\n" cd ${GITHUB_WORKSPACE}/${lib} PATH="${GITHUB_WORKSPACE}/bin:${PATH}" \ - make demos + make demos CMAKE_OPTIONS="-DSUITESPARSE_DEMOS=ON -DBUILD_TESTING=ON" echo "::endgroup::" done @@ -372,7 +428,7 @@ jobs: path: ${{ steps.ccache-prepare.outputs.ccachedir }} key: ${{ steps.ccache-prepare.outputs.key }} - - name: build example + - name: build example using CMake run: | cd ${GITHUB_WORKSPACE}/Example/build printf "::group::\033[0;32m==>\033[0m Configuring example\n" @@ -399,3 +455,50 @@ jobs: PATH="${GITHUB_WORKSPACE}/bin:${PATH}" \ ./my_cxx_demo_static echo "::endgroup::" + + - name: test Config + run: | + IFS=':' read -r -a libs <<< "${INSTALLED_LIBS}" + for lib in "${libs[@]}"; do + printf "::group:: \033[0;32m==>\033[0m Building with Config.cmake with library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/TestConfig/${lib} + cd build + cmake \ + -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/lib/cmake" \ + .. + cmake --build . --config Release + echo "::endgroup::" + done + + - name: build example using autotools + run: | + cd ${GITHUB_WORKSPACE}/Example + printf "::group::\033[0;32m==>\033[0m Configuring example\n" + autoreconf -fi + mkdir build-autotools + cd build-autotools + PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/lib/pkgconfig/ \ + ../configure --enable-shared --disable-static + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Building example\n" + make all + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Executing example\n" + printf "\033[1;35m C binary\033[0m\n" + PATH="${GITHUB_WORKSPACE}/bin:${PATH}" \ + ./my_demo + printf "\033[1;35m C++ binary\033[0m\n" + PATH="${GITHUB_WORKSPACE}/bin:${PATH}" \ + ./my_cxx_demo + echo "::endgroup::" + IFS=':' read -r -a libs <<< "${INSTALLED_LIBS}" + for lib in "${libs[@]}"; do + printf "::group:: \033[0;32m==>\033[0m Building test with library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/TestConfig/${lib} + autoreconf -fi + mkdir build-autotools && cd build-autotools + PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/lib/pkgconfig/ \ + ../configure --enable-shared --disable-static + make all + echo "::endgroup::" + done diff --git a/.github/workflows/root-cmakelists.yaml b/.github/workflows/root-cmakelists.yaml index 6dc761a71b..3e8efbac67 100644 --- a/.github/workflows/root-cmakelists.yaml +++ b/.github/workflows/root-cmakelists.yaml @@ -12,6 +12,10 @@ on: concurrency: ci-root-cmakelists-${{ github.ref }} +env: + # string with name of libraries that are installed + INSTALLED_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX:GraphBLAS:LAGraph" + jobs: ubuntu: @@ -140,6 +144,8 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \ -DBLA_VENDOR="OpenBLAS" \ + -DSUITESPARSE_DEMOS=OFF \ + -DBUILD_TESTING=OFF \ ${{ matrix.cuda-cmake-flags }} \ ${{ matrix.link-cmake-flags }} \ .. @@ -153,7 +159,7 @@ jobs: run: | printf "::group:: \033[0;32m==>\033[0m Configuring for demos\n" cd ${GITHUB_WORKSPACE}/build - cmake -DSUITESPARSE_DEMOS=ON .. + cmake -DSUITESPARSE_DEMOS=ON -DBUILD_TESTING=ON .. echo "::endgroup::" printf "::group:: \033[0;32m==>\033[0m Building demos\n" cd ${GITHUB_WORKSPACE}/build @@ -184,7 +190,7 @@ jobs: cd ${GITHUB_WORKSPACE}/build cmake --install . - - name: build example + - name: build example using CMake run: | cd ${GITHUB_WORKSPACE}/Example/build printf "::group::\033[0;32m==>\033[0m Configuring example\n" @@ -211,13 +217,63 @@ jobs: ./my_cxx_demo_static echo "::endgroup::" + - name: test Config + run: | + IFS=':' read -r -a libs <<< "${INSTALLED_LIBS}" + for lib in "${libs[@]}"; do + printf "::group:: \033[0;32m==>\033[0m Building Config.cmake with library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/TestConfig/${lib} + cd build + cmake \ + -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/lib/cmake" \ + .. + cmake --build . --config Release + echo "::endgroup::" + done + + - name: build example using autotools + run: | + cd ${GITHUB_WORKSPACE}/Example + printf "::group::\033[0;32m==>\033[0m Configuring example\n" + autoreconf -fi + mkdir build-autotools + cd build-autotools + if [ "${{ matrix.link }}" = static ]; then + _extra_config_flags="--enable-static --disable-shared" + else + _extra_config_flags="--enable-shared --disable-static" + fi + PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/lib/pkgconfig/ \ + ../configure ${_extra_config_flags} + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Building example\n" + make all + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Executing example\n" + printf "\033[1;35m C binary\033[0m\n" + LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/lib ./my_demo + printf "\033[1;35m C++ binary\033[0m\n" + LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/lib ./my_cxx_demo + echo "::endgroup::" + IFS=':' read -r -a libs <<< "${INSTALLED_LIBS}" + for lib in "${libs[@]}"; do + printf "::group:: \033[0;32m==>\033[0m Building test with library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/TestConfig/${lib} + autoreconf -fi + mkdir build-autotools && cd build-autotools + PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/lib/pkgconfig/ \ + ../configure ${_extra_config_flags} + make all + echo "::endgroup::" + done + msvc: # For available GitHub-hosted runners, see: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners runs-on: windows-latest - name: msvc (${{ matrix.openmp }} OpenMP ${{ matrix.cuda }} CUDA) + name: msvc (${{ matrix.openmp }} OpenMP ${{ matrix.cuda }} CUDA, ${{ matrix.link }}) defaults: run: @@ -231,6 +287,7 @@ jobs: matrix: openmp: [with, without] cuda: [without] + link: [both] include: - openmp: without openmp-cmake-flags: "-DSUITESPARSE_USE_OPENMP=OFF" @@ -239,6 +296,16 @@ jobs: cuda-cmake-flags: -DSUITESPARSE_USE_CUDA=ON -DCMAKE_CUDA_COMPILER_LAUNCHER="ccache" + link: both + - openmp: with + cuda: with + cuda-cmake-flags: + -DSUITESPARSE_USE_CUDA=ON + -DCMAKE_CUDA_COMPILER_LAUNCHER="ccache" + link: static + link-cmake-flags: + -DBUILD_SHARED_LIBS=OFF + -DBUILD_STATIC_LIBS=ON env: CHERE_INVOKING: 1 @@ -334,7 +401,7 @@ jobs: shell: msys2 {0} run: | echo "ccachedir=$(cygpath -m $(${CCACHE} -k cache_dir))" >> $GITHUB_OUTPUT - echo "key=ccache:msvc:root:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT + echo "key=ccache:msvc:root:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ matrix.link }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT - name: restore ccache # Setup the GitHub cache used to maintain the ccache from one job to the next @@ -344,8 +411,8 @@ jobs: key: ${{ steps.ccache-prepare.outputs.key }} # Prefer caches from the same branch. Fall back to caches from the dev branch. restore-keys: | - ccache:msvc:root:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ github.ref }} - ccache:msvc:root:${{ matrix.openmp }}:${{ matrix.cuda }}: + ccache:msvc:root:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ matrix.link }}:${{ github.ref }} + ccache:msvc:root:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ matrix.link }}: - name: configure ccache # Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota. @@ -377,8 +444,11 @@ jobs: -DSUITESPARSE_USE_FORTRAN=OFF \ -DBLA_VENDOR="All" \ -DPython_EXECUTABLE="C:/msys64/ucrt64/bin/python.exe" \ + -DSUITESPARSE_DEMOS=OFF \ + -DBUILD_TESTING=OFF \ ${{ matrix.openmp-cmake-flags }} \ ${{ matrix.cuda-cmake-flags }} \ + ${{ matrix.link-cmake-flags }} \ "${_extra_config[@]}" \ .. @@ -391,7 +461,7 @@ jobs: run: | printf "::group:: \033[0;32m==>\033[0m Configuring for demos\n" cd ${GITHUB_WORKSPACE}/build - cmake -DSUITESPARSE_DEMOS=ON .. + cmake -DSUITESPARSE_DEMOS=ON -DBUILD_TESTING=ON .. echo "::endgroup::" printf "::group:: \033[0;32m==>\033[0m Building demos\n" cd ${GITHUB_WORKSPACE}/build @@ -437,12 +507,14 @@ jobs: cmake --build . --config Release echo "::endgroup::" printf "::group::\033[0;32m==>\033[0m Executing example\n" - printf "\033[1;35m C binary with shared libraries\033[0m\n" - PATH="${GITHUB_WORKSPACE}/bin;${GITHUB_WORKSPACE}/dependencies/bin;${PATH}" \ - ./Release/my_demo - printf "\033[1;35m C++ binary with shared libraries\033[0m\n" - PATH="${GITHUB_WORKSPACE}/bin;${GITHUB_WORKSPACE}/dependencies/bin;${PATH}" \ - ./Release/my_cxx_demo + if [ -f ./my_demo -a -f ./my_cxx_demo ]; then + printf "\033[1;35m C binary with shared libraries\033[0m\n" + PATH="${GITHUB_WORKSPACE}/bin;${GITHUB_WORKSPACE}/dependencies/bin;${PATH}" \ + ./Release/my_demo + printf "\033[1;35m C++ binary with shared libraries\033[0m\n" + PATH="${GITHUB_WORKSPACE}/bin;${GITHUB_WORKSPACE}/dependencies/bin;${PATH}" \ + ./Release/my_cxx_demo + fi # We don't build a static version of GraphBLAS in CI. # So we need to prepare the environment also for the following tests. # Additionally, gmp, mpfr and BLAS are always shared libraries. @@ -453,3 +525,17 @@ jobs: PATH="${GITHUB_WORKSPACE}/bin;${GITHUB_WORKSPACE}/dependencies/bin;${PATH}" \ ./Release/my_cxx_demo_static echo "::endgroup::" + + - name: test Config + run: | + IFS=':' read -r -a libs <<< "${INSTALLED_LIBS}" + for lib in "${libs[@]}"; do + printf "::group:: \033[0;32m==>\033[0m Building with Config.cmake with library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/TestConfig/${lib} + cd build + cmake \ + -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/lib/cmake;C:/Miniconda/envs/test/Library;${GITHUB_WORKSPACE}/dependencies" \ + .. + cmake --build . --config Release + echo "::endgroup::" + done diff --git a/AMD/CMakeLists.txt b/AMD/CMakeLists.txt index c913d73903..3253759112 100644 --- a/AMD/CMakeLists.txt +++ b/AMD/CMakeLists.txt @@ -12,10 +12,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( AMD_DATE "Dec 30, 2023" ) +set ( AMD_DATE "Jan 10, 2024" ) set ( AMD_VERSION_MAJOR 3 CACHE STRING "" FORCE ) set ( AMD_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( AMD_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( AMD_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building AMD version: v" ${AMD_VERSION_MAJOR}. @@ -49,10 +49,10 @@ endif ( ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) endif ( ) diff --git a/AMD/Config/amd.h.in b/AMD/Config/amd.h.in index 885ca1ac7f..3192e11391 100644 --- a/AMD/Config/amd.h.in +++ b/AMD/Config/amd.h.in @@ -2,7 +2,7 @@ // AMD/Include/amd.h: approximate minimum degree ordering //------------------------------------------------------------------------------ -// AMD, Copyright (c) 1996-2023, Timothy A. Davis, Patrick R. Amestoy, and +// AMD, Copyright (c) 1996-2024, Timothy A. Davis, Patrick R. Amestoy, and // Iain S. Duff. All Rights Reserved. // SPDX-License-Identifier: BSD-3-clause @@ -388,11 +388,12 @@ void amd_version (int version [3]) ; #define AMD_SUBSUB_VERSION @AMD_VERSION_SUB@ #define AMD_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define AMD_VERSION AMD_VERSION_CODE(AMD_MAIN_VERSION,AMD_SUB_VERSION) +#define AMD_VERSION AMD_VERSION_CODE(@AMD_VERSION_MAJOR@,@AMD_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "AMD @AMD_VERSION_MAJOR@.@AMD_VERSION_MINOR@.@AMD_VERSION_SUB@ requires SuiteSparse_config 7.4 or later" +#define AMD__VERSION SUITESPARSE__VERCODE(@AMD_VERSION_MAJOR@,@AMD_VERSION_MINOR@,@AMD_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "AMD @AMD_VERSION_MAJOR@.@AMD_VERSION_MINOR@.@AMD_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif #endif diff --git a/AMD/Demo/amd_demo.out b/AMD/Demo/amd_demo.out index e9e19b4308..baa827eb94 100644 --- a/AMD/Demo/amd_demo.out +++ b/AMD/Demo/amd_demo.out @@ -1,7 +1,7 @@ -AMD version 3.3.0, date: Dec 30, 2023 +AMD version 3.3.1, date: Jan 10, 2024 AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from amd_order: 0 (should be 0) -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/AMD/Demo/amd_demo2.out b/AMD/Demo/amd_demo2.out index 9a3237dd05..aa11272d47 100644 --- a/AMD/Demo/amd_demo2.out +++ b/AMD/Demo/amd_demo2.out @@ -1,7 +1,7 @@ AMD demo, with a jumbled version of the 24-by-24 Harwell/Boeing matrix, can_24: -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -144,7 +144,7 @@ Plot of symmetric matrix to be ordered by amd_order: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from amd_order: 1 (should be 1) -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 102 diff --git a/AMD/Demo/amd_l_demo.out b/AMD/Demo/amd_l_demo.out index 4579da20e1..34234be69c 100644 --- a/AMD/Demo/amd_l_demo.out +++ b/AMD/Demo/amd_l_demo.out @@ -1,7 +1,7 @@ -AMD version 3.3.0, date: Dec 30, 2023 +AMD version 3.3.1, date: Jan 10, 2024 AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from amd_l_order: 0 (should be 0) -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/AMD/Doc/AMD_UserGuide.pdf b/AMD/Doc/AMD_UserGuide.pdf index 71a5a402ed..189cfbc6ff 100644 Binary files a/AMD/Doc/AMD_UserGuide.pdf and b/AMD/Doc/AMD_UserGuide.pdf differ diff --git a/AMD/Doc/ChangeLog b/AMD/Doc/ChangeLog index 5a3b39cd9e..3828f5ab22 100644 --- a/AMD/Doc/ChangeLog +++ b/AMD/Doc/ChangeLog @@ -1,3 +1,7 @@ +Jan 10, 2024: version 3.3.1 + + * minor updates to build system + Dec 30, 2023: version 3.3.0 * major change to build system: by Markus Mützel diff --git a/AMD/Doc/amd_version.tex b/AMD/Doc/amd_version.tex index 4517f92a28..31528c9f32 100644 --- a/AMD/Doc/amd_version.tex +++ b/AMD/Doc/amd_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/AMD -\date{VERSION 3.3.0, Dec 30, 2023} +\date{VERSION 3.3.1, Jan 10, 2024} diff --git a/AMD/Include/amd.h b/AMD/Include/amd.h index fb2fd4beb0..188ee5a67f 100644 --- a/AMD/Include/amd.h +++ b/AMD/Include/amd.h @@ -2,7 +2,7 @@ // AMD/Include/amd.h: approximate minimum degree ordering //------------------------------------------------------------------------------ -// AMD, Copyright (c) 1996-2023, Timothy A. Davis, Patrick R. Amestoy, and +// AMD, Copyright (c) 1996-2024, Timothy A. Davis, Patrick R. Amestoy, and // Iain S. Duff. All Rights Reserved. // SPDX-License-Identifier: BSD-3-clause @@ -382,17 +382,18 @@ void amd_version (int version [3]) ; * Versions 1.1 and earlier of AMD do not include a #define'd version number. */ -#define AMD_DATE "Dec 30, 2023" +#define AMD_DATE "Jan 10, 2024" #define AMD_MAIN_VERSION 3 #define AMD_SUB_VERSION 3 -#define AMD_SUBSUB_VERSION 0 +#define AMD_SUBSUB_VERSION 1 #define AMD_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define AMD_VERSION AMD_VERSION_CODE(AMD_MAIN_VERSION,AMD_SUB_VERSION) +#define AMD_VERSION AMD_VERSION_CODE(3,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "AMD 3.3.0 requires SuiteSparse_config 7.4 or later" +#define AMD__VERSION SUITESPARSE__VERCODE(3,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "AMD 3.3.1 requires SuiteSparse_config 7.5.0 or later" #endif #endif diff --git a/AMD/Makefile b/AMD/Makefile index e643a244ff..15da7ceab0 100644 --- a/AMD/Makefile +++ b/AMD/Makefile @@ -53,19 +53,19 @@ all: library demos: library ( cd build && cmake $(CMAKE_OPTIONS) -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j${JOBS} ) - ./build/amd_demo > build/amd_demo.out - - diff --strip-trailing-cr Demo/amd_demo.out build/amd_demo.out - ./build/amd_l_demo > build/amd_l_demo.out - - diff --strip-trailing-cr Demo/amd_l_demo.out build/amd_l_demo.out - ./build/amd_demo2 > build/amd_demo2.out - - diff --strip-trailing-cr Demo/amd_demo2.out build/amd_demo2.out - ./build/amd_simple > build/amd_simple.out - - diff --strip-trailing-cr Demo/amd_simple.out build/amd_simple.out + ./build/amd_demo > build/amd_demo.out && ( command -v d2u && d2u ./build/amd_demo.out || true ) + - diff Demo/amd_demo.out build/amd_demo.out + ./build/amd_l_demo > build/amd_l_demo.out && ( command -v d2u && d2u ./build/amd_l_demo.out || true ) + - diff Demo/amd_l_demo.out build/amd_l_demo.out + ./build/amd_demo2 > build/amd_demo2.out && ( command -v d2u && d2u ./build/amd_demo2.out || true ) + - diff Demo/amd_demo2.out build/amd_demo2.out + ./build/amd_simple > build/amd_simple.out && ( command -v d2u && d2u ./build/amd_simple.out || true ) + - diff Demo/amd_simple.out build/amd_simple.out # Fortran demos will fail if no Fortran compiler is available - - ./build/amd_f77simple > build/amd_f77simple.out - - diff --strip-trailing-cr Demo/amd_f77simple.out build/amd_f77simple.out - - ./build/amd_f77demo > build/amd_f77demo.out - - diff --strip-trailing-cr Demo/amd_f77demo.out build/amd_f77demo.out + - ./build/amd_f77simple > build/amd_f77simple.out && ( command -v d2u && d2u ./build/amd_f77simple.out || true ) + - diff Demo/amd_f77simple.out build/amd_f77simple.out + - ./build/amd_f77demo > build/amd_f77demo.out && ( command -v d2u && d2u ./build/amd_f77demo.out || true ) + - diff Demo/amd_f77demo.out build/amd_f77demo.out # just compile after running cmake; do not run cmake again remake: diff --git a/BTF/CMakeLists.txt b/BTF/CMakeLists.txt index 18c177e794..059bb80c25 100644 --- a/BTF/CMakeLists.txt +++ b/BTF/CMakeLists.txt @@ -12,10 +12,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( BTF_DATE "Dec 30, 2023" ) +set ( BTF_DATE "Jan 10, 2024" ) set ( BTF_VERSION_MAJOR 2 CACHE STRING "" FORCE ) set ( BTF_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( BTF_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( BTF_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building BTF version: v" ${BTF_VERSION_MAJOR}. @@ -44,10 +44,10 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) endif ( ) diff --git a/BTF/Config/btf.h.in b/BTF/Config/btf.h.in index 057a9df525..a5985db8af 100644 --- a/BTF/Config/btf.h.in +++ b/BTF/Config/btf.h.in @@ -2,7 +2,7 @@ // BTF/Include/btf.h: include file for BTF //------------------------------------------------------------------------------ -// BTF, Copyright (c) 2004-2023, University of Florida. All Rights Reserved. +// BTF, Copyright (c) 2004-2024, University of Florida. All Rights Reserved. // Author: Timothy A. Davis. // SPDX-License-Identifier: LGPL-2.1+ @@ -257,7 +257,7 @@ void btf_version (int version [3]) ; * * This also works during compile-time: * - * #if (BTF >= BTF_VERSION_CODE (1,2)) + * #if (BTF_VERSION >= BTF_VERSION_CODE (1,2)) * printf ("This is version 1.2 or later\n") ; * #else * printf ("This is an early version\n") ; @@ -270,11 +270,12 @@ void btf_version (int version [3]) ; #define BTF_SUBSUB_VERSION @BTF_VERSION_SUB@ #define BTF_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define BTF_VERSION BTF_VERSION_CODE(BTF_MAIN_VERSION,BTF_SUB_VERSION) +#define BTF_VERSION BTF_VERSION_CODE(@BTF_VERSION_MAJOR@,@BTF_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "BTF @BTF_VERSION_MAJOR@.@BTF_VERSION_MINOR@.@BTF_VERSION_SUB@ requires SuiteSparse_config 7.4 or later" +#define BTF__VERSION SUITESPARSE__VERCODE(@BTF_VERSION_MAJOR@,@BTF_VERSION_MINOR@,@BTF_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "BTF @BTF_VERSION_MAJOR@.@BTF_VERSION_MINOR@.@BTF_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif #endif diff --git a/BTF/Doc/ChangeLog b/BTF/Doc/ChangeLog index 4c181456be..d857cbc6ed 100644 --- a/BTF/Doc/ChangeLog +++ b/BTF/Doc/ChangeLog @@ -1,3 +1,7 @@ +Jan 10, 2024: version 2.3.1 + + * minor updates to build system + Dec 30, 2023: version 2.3.0 * major change to build system: by Markus Mützel diff --git a/BTF/Include/btf.h b/BTF/Include/btf.h index 768e7daf01..c152e879aa 100644 --- a/BTF/Include/btf.h +++ b/BTF/Include/btf.h @@ -2,7 +2,7 @@ // BTF/Include/btf.h: include file for BTF //------------------------------------------------------------------------------ -// BTF, Copyright (c) 2004-2023, University of Florida. All Rights Reserved. +// BTF, Copyright (c) 2004-2024, University of Florida. All Rights Reserved. // Author: Timothy A. Davis. // SPDX-License-Identifier: LGPL-2.1+ @@ -257,24 +257,25 @@ void btf_version (int version [3]) ; * * This also works during compile-time: * - * #if (BTF >= BTF_VERSION_CODE (1,2)) + * #if (BTF_VERSION >= BTF_VERSION_CODE (1,2)) * printf ("This is version 1.2 or later\n") ; * #else * printf ("This is an early version\n") ; * #endif */ -#define BTF_DATE "Dec 30, 2023" +#define BTF_DATE "Jan 10, 2024" #define BTF_MAIN_VERSION 2 #define BTF_SUB_VERSION 3 -#define BTF_SUBSUB_VERSION 0 +#define BTF_SUBSUB_VERSION 1 #define BTF_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define BTF_VERSION BTF_VERSION_CODE(BTF_MAIN_VERSION,BTF_SUB_VERSION) +#define BTF_VERSION BTF_VERSION_CODE(2,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "BTF 2.3.0 requires SuiteSparse_config 7.4 or later" +#define BTF__VERSION SUITESPARSE__VERCODE(2,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "BTF 2.3.1 requires SuiteSparse_config 7.5.0 or later" #endif #endif diff --git a/CAMD/CMakeLists.txt b/CAMD/CMakeLists.txt index 77e004d834..e65d546d00 100644 --- a/CAMD/CMakeLists.txt +++ b/CAMD/CMakeLists.txt @@ -2,7 +2,7 @@ # SuiteSparse/CAMD/CMakeLists.txt: cmake for CAMD #------------------------------------------------------------------------------- -# Copyright (c) 2007-2023, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 2007-2024, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- @@ -11,10 +11,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( CAMD_DATE "Dec 30, 2023" ) +set ( CAMD_DATE "Jan 10, 2024" ) set ( CAMD_VERSION_MAJOR 3 CACHE STRING "" FORCE ) set ( CAMD_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( CAMD_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( CAMD_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building CAMD version: v" ${CAMD_VERSION_MAJOR}. @@ -43,10 +43,10 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) endif ( ) diff --git a/CAMD/Config/camd.h.in b/CAMD/Config/camd.h.in index 70d5c9fb52..88da242065 100644 --- a/CAMD/Config/camd.h.in +++ b/CAMD/Config/camd.h.in @@ -2,7 +2,7 @@ // CAMD/Include/camd.h: constrained approximate minimum degree ordering //------------------------------------------------------------------------------ -// CAMD, Copyright (c) 1996-2023, Timothy A. Davis, Yanqing Chen, +// CAMD, Copyright (c) 1996-2024, Timothy A. Davis, Yanqing Chen, // Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. // SPDX-License-Identifier: BSD-3-clause @@ -398,11 +398,12 @@ void camd_version (int version [3]) ; #define CAMD_SUBSUB_VERSION @CAMD_VERSION_SUB@ #define CAMD_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define CAMD_VERSION CAMD_VERSION_CODE(CAMD_MAIN_VERSION,CAMD_SUB_VERSION) +#define CAMD_VERSION CAMD_VERSION_CODE(@CAMD_VERSION_MAJOR@,@CAMD_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "CAMD @CAMD_VERSION_MAJOR@.@CAMD_VERSION_MINOR@.@CAMD_VERSION_SUB@ requires SuiteSparse_config 7.4 or later" +#define CAMD__VERSION SUITESPARSE__VERCODE(@CAMD_VERSION_MAJOR@,@CAMD_VERSION_MINOR@,@CAMD_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "CAMD @CAMD_VERSION_MAJOR@.@CAMD_VERSION_MINOR@.@CAMD_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif #endif diff --git a/CAMD/Demo/camd_demo.out b/CAMD/Demo/camd_demo.out index fce82ea167..51363cab7d 100644 --- a/CAMD/Demo/camd_demo.out +++ b/CAMD/Demo/camd_demo.out @@ -1,7 +1,7 @@ -CAMD version 3.3.0, date: Dec 30, 2023 +CAMD version 3.3.1, date: Jan 10, 2024 CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -camd version 3.3.0, Dec 30, 2023: approximate minimum degree ordering: +camd version 3.3.1, Jan 10, 2024: approximate minimum degree ordering: dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from camd_order: 0 (should be 0) -CAMD version 3.3.0, Dec 30, 2023, results: +CAMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/CAMD/Demo/camd_demo2.out b/CAMD/Demo/camd_demo2.out index 04f0db8010..ae843e77ad 100644 --- a/CAMD/Demo/camd_demo2.out +++ b/CAMD/Demo/camd_demo2.out @@ -1,7 +1,7 @@ CAMD demo, with a jumbled version of the 24-by-24 Harwell/Boeing matrix, can_24: -camd version 3.3.0, Dec 30, 2023: approximate minimum degree ordering: +camd version 3.3.1, Jan 10, 2024: approximate minimum degree ordering: dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -144,7 +144,7 @@ Plot of symmetric matrix to be ordered by camd_order: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from camd_order: 1 (should be 1) -CAMD version 3.3.0, Dec 30, 2023, results: +CAMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 102 diff --git a/CAMD/Demo/camd_l_demo.out b/CAMD/Demo/camd_l_demo.out index 2898584d17..9ded095060 100644 --- a/CAMD/Demo/camd_l_demo.out +++ b/CAMD/Demo/camd_l_demo.out @@ -1,7 +1,7 @@ -CAMD version 3.3.0, date: Dec 30, 2023 +CAMD version 3.3.1, date: Jan 10, 2024 CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -camd version 3.3.0, Dec 30, 2023: approximate minimum degree ordering: +camd version 3.3.1, Jan 10, 2024: approximate minimum degree ordering: dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from camd_l_order: 0 (should be 0) -CAMD version 3.3.0, Dec 30, 2023, results: +CAMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/CAMD/Doc/CAMD_UserGuide.pdf b/CAMD/Doc/CAMD_UserGuide.pdf index 42d0dde631..8d389f5d2b 100644 Binary files a/CAMD/Doc/CAMD_UserGuide.pdf and b/CAMD/Doc/CAMD_UserGuide.pdf differ diff --git a/CAMD/Doc/ChangeLog b/CAMD/Doc/ChangeLog index 5614229b18..10ef3f405d 100644 --- a/CAMD/Doc/ChangeLog +++ b/CAMD/Doc/ChangeLog @@ -1,3 +1,7 @@ +Jan 10, 2024: version 3.3.1 + + * minor updates to build system + Dec 30, 2023: version 3.3.0 * major change to build system: by Markus Mützel diff --git a/CAMD/Doc/camd_version.tex b/CAMD/Doc/camd_version.tex index c92da18399..4f64f7398e 100644 --- a/CAMD/Doc/camd_version.tex +++ b/CAMD/Doc/camd_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/CAMD -\date{VERSION 3.3.0, Dec 30, 2023} +\date{VERSION 3.3.1, Jan 10, 2024} diff --git a/CAMD/Include/camd.h b/CAMD/Include/camd.h index 59a06c10c9..dcec4130a8 100644 --- a/CAMD/Include/camd.h +++ b/CAMD/Include/camd.h @@ -2,7 +2,7 @@ // CAMD/Include/camd.h: constrained approximate minimum degree ordering //------------------------------------------------------------------------------ -// CAMD, Copyright (c) 1996-2023, Timothy A. Davis, Yanqing Chen, +// CAMD, Copyright (c) 1996-2024, Timothy A. Davis, Yanqing Chen, // Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. // SPDX-License-Identifier: BSD-3-clause @@ -392,17 +392,18 @@ void camd_version (int version [3]) ; * #endif */ -#define CAMD_DATE "Dec 30, 2023" +#define CAMD_DATE "Jan 10, 2024" #define CAMD_MAIN_VERSION 3 #define CAMD_SUB_VERSION 3 -#define CAMD_SUBSUB_VERSION 0 +#define CAMD_SUBSUB_VERSION 1 #define CAMD_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define CAMD_VERSION CAMD_VERSION_CODE(CAMD_MAIN_VERSION,CAMD_SUB_VERSION) +#define CAMD_VERSION CAMD_VERSION_CODE(3,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "CAMD 3.3.0 requires SuiteSparse_config 7.4 or later" +#define CAMD__VERSION SUITESPARSE__VERCODE(3,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "CAMD 3.3.1 requires SuiteSparse_config 7.5.0 or later" #endif #endif diff --git a/CAMD/Makefile b/CAMD/Makefile index 701b32ff86..e01b125694 100644 --- a/CAMD/Makefile +++ b/CAMD/Makefile @@ -53,14 +53,14 @@ all: library demos: library ( cd build && cmake $(CMAKE_OPTIONS) -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j${JOBS} ) - ./build/camd_demo > build/camd_demo.out - - diff --strip-trailing-cr Demo/camd_demo.out build/camd_demo.out - ./build/camd_l_demo > build/camd_l_demo.out - - diff --strip-trailing-cr Demo/camd_l_demo.out build/camd_l_demo.out - ./build/camd_demo2 > build/camd_demo2.out - - diff --strip-trailing-cr Demo/camd_demo2.out build/camd_demo2.out - ./build/camd_simple > build/camd_simple.out - - diff --strip-trailing-cr Demo/camd_simple.out build/camd_simple.out + ./build/camd_demo > build/camd_demo.out && ( command -v d2u && d2u ./build/amd_demo.out || true ) + - diff Demo/camd_demo.out build/camd_demo.camd_demo + ./build/camd_l_demo > build/camd_l_demo.out && ( command -v d2u && d2u ./build/camd_l_demo.out || true ) + - diff Demo/camd_l_demo.out build/camd_l_demo.out + ./build/camd_demo2 > build/camd_demo2.out && ( command -v d2u && d2u ./build/camd_demo2.out || true ) + - diff Demo/camd_demo2.out build/camd_demo2.out + ./build/camd_simple > build/camd_simple.out && ( command -v d2u && d2u ./build/camd_simple.out || true ) + - diff Demo/camd_simple.out build/camd_simple.out # just compile after running cmake&& do not run cmake again remake: diff --git a/CCOLAMD/CMakeLists.txt b/CCOLAMD/CMakeLists.txt index 7a27d5f33a..3dae5d98d8 100644 --- a/CCOLAMD/CMakeLists.txt +++ b/CCOLAMD/CMakeLists.txt @@ -2,7 +2,7 @@ # SuiteSparse/CCOLAMD/CMakeLists.txt: cmake for CCOLAMD #------------------------------------------------------------------------------- -# Copyright (c) 2005-2023, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 2005-2024, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- @@ -11,10 +11,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( CCOLAMD_DATE "Dec 30, 2023" ) +set ( CCOLAMD_DATE "Jan 10, 2024" ) set ( CCOLAMD_VERSION_MAJOR 3 CACHE STRING "" FORCE ) set ( CCOLAMD_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( CCOLAMD_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( CCOLAMD_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building CCOLAMD version: v" ${CCOLAMD_VERSION_MAJOR}. @@ -43,10 +43,10 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) endif ( ) diff --git a/CCOLAMD/Config/ccolamd.h.in b/CCOLAMD/Config/ccolamd.h.in index 554a391854..f7aff9fa03 100644 --- a/CCOLAMD/Config/ccolamd.h.in +++ b/CCOLAMD/Config/ccolamd.h.in @@ -2,7 +2,7 @@ // CCOLAMD/Include/ccolamd.h: constrained column approx. min. degree ordering //------------------------------------------------------------------------------ -// CCOLAMD, Copyright (c) 1996-2023, Timothy A. Davis, Sivasankaran +// CCOLAMD, Copyright (c) 1996-2024, Timothy A. Davis, Sivasankaran // Rajamanickam, and Stefan Larimore. All Rights Reserved. // SPDX-License-Identifier: BSD-3-clause @@ -42,12 +42,12 @@ #define CCOLAMD_SUBSUB_VERSION @CCOLAMD_VERSION_SUB@ #define CCOLAMD_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define CCOLAMD_VERSION \ - CCOLAMD_VERSION_CODE(CCOLAMD_MAIN_VERSION,CCOLAMD_SUB_VERSION) +#define CCOLAMD_VERSION CCOLAMD_VERSION_CODE(@CCOLAMD_VERSION_MAJOR@,@CCOLAMD_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "CCOLAMD @CCOLAMD_VERSION_MAJOR@.@CCOLAMD_VERSION_MINOR@.@CCOLAMD_VERSION_SUB@ requires SuiteSparse_config 7.4 or later" +#define CCOLAMD__VERSION SUITESPARSE__VERCODE(@CCOLAMD_VERSION_MAJOR@,@CCOLAMD_VERSION_MINOR@,@CCOLAMD_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "CCOLAMD @CCOLAMD_VERSION_MAJOR@.@CCOLAMD_VERSION_MINOR@.@CCOLAMD_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif /* ========================================================================== */ diff --git a/CCOLAMD/Demo/ccolamd_example.out b/CCOLAMD/Demo/ccolamd_example.out index ccc7e4857d..89ce91dd51 100644 --- a/CCOLAMD/Demo/ccolamd_example.out +++ b/CCOLAMD/Demo/ccolamd_example.out @@ -1,4 +1,4 @@ -CCOLAMD v3.3.0 +CCOLAMD v3.3.1 ccolamd 5-by-4 input matrix: Column 0, with 3 entries: row 0 @@ -16,7 +16,7 @@ Column 3, with 2 entries: row 1 row 3 -ccolamd version 3.3.0, Dec 30, 2023: OK. +ccolamd version 3.3.1, Jan 10, 2024: OK. ccolamd: number of dense or empty rows ignored: 0 ccolamd: number of dense or empty columns ignored: 0 ccolamd: number of garbage collections performed: 0 @@ -39,7 +39,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -csymamd version 3.3.0, Dec 30, 2023: OK. +csymamd version 3.3.1, Jan 10, 2024: OK. csymamd: number of dense or empty rows ignored: 0 csymamd: number of dense or empty columns ignored: 0 csymamd: number of garbage collections performed: 0 diff --git a/CCOLAMD/Demo/ccolamd_l_example.out b/CCOLAMD/Demo/ccolamd_l_example.out index 8fef5e268a..ec9a7186c3 100644 --- a/CCOLAMD/Demo/ccolamd_l_example.out +++ b/CCOLAMD/Demo/ccolamd_l_example.out @@ -1,4 +1,4 @@ -CCOLAMD v3.3.0 +CCOLAMD v3.3.1 ccolamd 5-by-4 input matrix: Column 0, with 3 entries: row 0 @@ -16,7 +16,7 @@ Column 3, with 2 entries: row 1 row 3 -ccolamd version 3.3.0, Dec 30, 2023: OK. +ccolamd version 3.3.1, Jan 10, 2024: OK. ccolamd: number of dense or empty rows ignored: 0 ccolamd: number of dense or empty columns ignored: 0 ccolamd: number of garbage collections performed: 0 @@ -39,7 +39,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -csymamd version 3.3.0, Dec 30, 2023: OK. +csymamd version 3.3.1, Jan 10, 2024: OK. csymamd: number of dense or empty rows ignored: 0 csymamd: number of dense or empty columns ignored: 0 csymamd: number of garbage collections performed: 0 diff --git a/CCOLAMD/Doc/ChangeLog b/CCOLAMD/Doc/ChangeLog index fa92ef772e..52b5e564c5 100644 --- a/CCOLAMD/Doc/ChangeLog +++ b/CCOLAMD/Doc/ChangeLog @@ -1,3 +1,7 @@ +Jan 10, 2024: version 3.3.1 + + * minor updates to build system + Dec 30, 2023: version 3.3.0 * major change to build system: by Markus Mützel diff --git a/CCOLAMD/Include/ccolamd.h b/CCOLAMD/Include/ccolamd.h index 0df99feffa..cf20524a96 100644 --- a/CCOLAMD/Include/ccolamd.h +++ b/CCOLAMD/Include/ccolamd.h @@ -2,7 +2,7 @@ // CCOLAMD/Include/ccolamd.h: constrained column approx. min. degree ordering //------------------------------------------------------------------------------ -// CCOLAMD, Copyright (c) 1996-2023, Timothy A. Davis, Sivasankaran +// CCOLAMD, Copyright (c) 1996-2024, Timothy A. Davis, Sivasankaran // Rajamanickam, and Stefan Larimore. All Rights Reserved. // SPDX-License-Identifier: BSD-3-clause @@ -36,18 +36,18 @@ * #endif */ -#define CCOLAMD_DATE "Dec 30, 2023" +#define CCOLAMD_DATE "Jan 10, 2024" #define CCOLAMD_MAIN_VERSION 3 #define CCOLAMD_SUB_VERSION 3 -#define CCOLAMD_SUBSUB_VERSION 0 +#define CCOLAMD_SUBSUB_VERSION 1 #define CCOLAMD_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define CCOLAMD_VERSION \ - CCOLAMD_VERSION_CODE(CCOLAMD_MAIN_VERSION,CCOLAMD_SUB_VERSION) +#define CCOLAMD_VERSION CCOLAMD_VERSION_CODE(3,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "CCOLAMD 3.3.0 requires SuiteSparse_config 7.4 or later" +#define CCOLAMD__VERSION SUITESPARSE__VERCODE(3,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "CCOLAMD 3.3.1 requires SuiteSparse_config 7.5.0 or later" #endif /* ========================================================================== */ diff --git a/CCOLAMD/Makefile b/CCOLAMD/Makefile index e7d9d43670..4b7e8ec8cc 100644 --- a/CCOLAMD/Makefile +++ b/CCOLAMD/Makefile @@ -53,10 +53,10 @@ all: library demos: library ( cd build && cmake $(CMAKE_OPTIONS) -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j${JOBS} ) - - ./build/ccolamd_example > ./build/ccolamd_example.out - - diff --strip-trailing-cr ./Demo/ccolamd_example.out ./build/ccolamd_example.out - - ./build/ccolamd_l_example > ./build/ccolamd_l_example.out - - diff --strip-trailing-cr ./Demo/ccolamd_l_example.out ./build/ccolamd_l_example.out + - ./build/ccolamd_example > ./build/ccolamd_example.out && ( command -v d2u && d2u ./build/ccolamd_example.out || true ) + - diff ./Demo/ccolamd_example.out ./build/ccolamd_example.out + - ./build/ccolamd_l_example > ./build/ccolamd_l_example.out && ( command -v d2u && d2u ./build/ccolamd_l_example.out || true ) + - diff ./Demo/ccolamd_l_example.out ./build/ccolamd_l_example.out # just compile after running cmake; do not run cmake again remake: diff --git a/CHOLMOD/CMakeLists.txt b/CHOLMOD/CMakeLists.txt index 44e1603487..ed7486155e 100644 --- a/CHOLMOD/CMakeLists.txt +++ b/CHOLMOD/CMakeLists.txt @@ -12,10 +12,10 @@ # cmake 3.22 is required to find the BLAS/LAPACK cmake_minimum_required ( VERSION 3.22 ) -set ( CHOLMOD_DATE "Dec 30, 2023" ) +set ( CHOLMOD_DATE "Jan 10, 2024" ) set ( CHOLMOD_VERSION_MAJOR 5 CACHE STRING "" FORCE ) set ( CHOLMOD_VERSION_MINOR 1 CACHE STRING "" FORCE ) -set ( CHOLMOD_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( CHOLMOD_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building CHOLMOD version: v" ${CHOLMOD_VERSION_MAJOR}. @@ -88,7 +88,11 @@ if ( NOT SUITESPARSE_USE_OPENMP ) set ( CHOLMOD_USE_OPENMP "OFF" CACHE STRING "" FORCE ) endif ( ) if ( CHOLMOD_USE_OPENMP ) - find_package ( OpenMP GLOBAL ) + if ( CMAKE_VERSION VERSION_LESS 3.24 ) + find_package ( OpenMP COMPONENTS C ) + else ( ) + find_package ( OpenMP COMPONENTS C GLOBAL ) + endif ( ) else ( ) # OpenMP has been disabled set ( OpenMP_C_FOUND OFF ) @@ -111,22 +115,22 @@ endif ( ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) - find_package ( AMD 3.3.0 + find_package ( AMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::AMD ) - find_package ( AMD 3.3.0 REQUIRED ) + find_package ( AMD 3.3.1 REQUIRED ) endif ( ) - find_package ( COLAMD 3.3.0 + find_package ( COLAMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::COLAMD ) - find_package ( COLAMD 3.3.0 REQUIRED ) + find_package ( COLAMD 3.3.1 REQUIRED ) endif ( ) endif ( ) @@ -230,16 +234,16 @@ endif ( ) if ( CHOLMOD_CAMD AND NOT SUITESPARSE_ROOT_CMAKELISTS ) # find CAMD and CCOLAMD - find_package ( CAMD 3.3.0 + find_package ( CAMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::CAMD ) - find_package ( CAMD 3.3.0 ) + find_package ( CAMD 3.3.1 ) endif ( ) - find_package ( CCOLAMD 3.3.0 + find_package ( CCOLAMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::CCOLAMD ) - find_package ( CCOLAMD 3.3.0 ) + find_package ( CCOLAMD 3.3.1 ) endif ( ) if ( NOT CAMD_FOUND OR NOT CCOLAMD_FOUND ) @@ -471,7 +475,9 @@ else ( ) endif ( ) # libm: -if ( NOT WIN32 ) +include ( CheckSymbolExists ) +check_symbol_exists ( fmax "math.h" NO_LIBM ) +if ( NOT NO_LIBM ) if ( BUILD_SHARED_LIBS ) target_link_libraries ( CHOLMOD PRIVATE m ) endif ( ) @@ -532,9 +538,20 @@ if ( CHOLMOD_HAS_CUDA ) $ ) endif ( ) if ( BUILD_STATIC_LIBS ) - target_link_libraries ( CHOLMOD_static PRIVATE CUDA::nvrtc CUDA::cudart_static CUDA::cublas ) - target_include_directories ( CHOLMOD_static INTERFACE - $ ) + target_link_libraries ( CHOLMOD_static PRIVATE CUDA::nvrtc CUDA::cudart_static ) + # FIXME: Ok to hardcode CUDA library names like this? + list ( APPEND CHOLMOD_STATIC_LIBS "-L${CUDAToolkit_LIBRARY_DIR};-lcuda;-lcudart_static" ) + if ( TARGET CUDA::cublas_static ) + target_link_libraries ( CHOLMOD_static PRIVATE CUDA::cublas_static ) + target_include_directories ( CHOLMOD_static INTERFACE + $ ) + list ( APPEND CHOLMOD_STATIC_LIBS "-lcublas_static;-lcublasLt_static;-lculibos" ) + else ( ) + target_link_libraries ( CHOLMOD_static PRIVATE CUDA::cublas ) + target_include_directories ( CHOLMOD_static INTERFACE + $ ) + list ( APPEND CHOLMOD_STATIC_LIBS "-lcublas" ) + endif ( ) endif ( ) set ( old_CMAKE_EXTRA_INCLUDE_FILES CMAKE_EXTRA_INCLUDE_FILES ) @@ -628,6 +645,11 @@ if ( NOT MSVC ) set ( CHOLMOD_STATIC_LIBS_LIST ${CHOLMOD_STATIC_LIBS} ) set ( CHOLMOD_STATIC_LIBS "" ) foreach ( _lib ${CHOLMOD_STATIC_LIBS_LIST} ) + if ( ${_lib} MATCHES "-[lL].*" ) + # take -L or -l flags as is + set ( CHOLMOD_STATIC_LIBS "${CHOLMOD_STATIC_LIBS} ${_lib}" ) + continue () + endif ( ) string ( FIND ${_lib} "." _pos REVERSE ) if ( ${_pos} EQUAL "-1" ) set ( CHOLMOD_STATIC_LIBS "${CHOLMOD_STATIC_LIBS} -l${_lib}" ) @@ -808,7 +830,7 @@ if ( SUITESPARSE_DEMOS OR BUILD_TESTING ) if ( WIN32 AND BUILD_SHARED_LIBS ) # Set PATH to pick up the necessary libraries for all tests - set ( CHOLMOD_CTEST_NAMES + set ( CHOLMOD_CTEST_NAMES CHOLMOD_int32_double_bcsstk01 CHOLMOD_int64_double_bcsstk01 CHOLMOD_int32_single_bcsstk01 CHOLMOD_int64_single_bcsstk01 CHOLMOD_int32_double_lp_afiro CHOLMOD_int64_double_lp_afiro CHOLMOD_int32_single_lp_afiro CHOLMOD_int64_single_lp_afiro CHOLMOD_int32_double_can24 CHOLMOD_int64_double_can24 CHOLMOD_int32_single_can24 CHOLMOD_int64_single_can24 diff --git a/CHOLMOD/Cholesky/cholmod_amd.c b/CHOLMOD/Cholesky/cholmod_amd.c index 0d05701177..8c334206cd 100644 --- a/CHOLMOD/Cholesky/cholmod_amd.c +++ b/CHOLMOD/Cholesky/cholmod_amd.c @@ -34,7 +34,7 @@ #include "amd.h" #if (!defined (AMD_VERSION) || (AMD_VERSION < AMD_VERSION_CODE (3,3))) -#error "CHOLMOD:Cholesky requires AMD 3.3.0 or later" +#error "CHOLMOD:Cholesky requires AMD 3.3.1 or later" #endif //------------------------------------------------------------------------------ diff --git a/CHOLMOD/Cholesky/cholmod_colamd.c b/CHOLMOD/Cholesky/cholmod_colamd.c index 31a16116e9..4c1c3f0ab0 100644 --- a/CHOLMOD/Cholesky/cholmod_colamd.c +++ b/CHOLMOD/Cholesky/cholmod_colamd.c @@ -29,7 +29,7 @@ #include "colamd.h" #if (!defined (COLAMD_VERSION) || (COLAMD_VERSION < COLAMD_VERSION_CODE (3,3))) -#error "CHOLMOD:Cholesky requires COLAMD 3.3.0 or later" +#error "CHOLMOD:Cholesky requires COLAMD 3.3.1 or later" #endif //------------------------------------------------------------------------------ diff --git a/CHOLMOD/Config/CHOLMOD.pc.in b/CHOLMOD/Config/CHOLMOD.pc.in index d22987a890..fb9d43b52d 100644 --- a/CHOLMOD/Config/CHOLMOD.pc.in +++ b/CHOLMOD/Config/CHOLMOD.pc.in @@ -7,8 +7,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -# FIXME: Which flags do we need to statically link CUDA if needed? - Name: CHOLMOD URL: https://github.com/DrTimothyAldenDavis/SuiteSparse Description: Routines for factorizing sparse symmetric positive definite matrices in SuiteSparse diff --git a/CHOLMOD/Config/CHOLMODConfig.cmake.in b/CHOLMOD/Config/CHOLMODConfig.cmake.in index 5415d32146..602a0da63d 100644 --- a/CHOLMOD/Config/CHOLMODConfig.cmake.in +++ b/CHOLMOD/Config/CHOLMODConfig.cmake.in @@ -53,7 +53,7 @@ endif ( ) # Look for OpenMP if ( @CHOLMOD_HAS_OPENMP@ AND NOT OpenMP_C_FOUND ) - find_dependency ( OpenMP ) + find_dependency ( OpenMP COMPONENTS C ) if ( NOT OpenMP_C_FOUND ) set ( _dependencies_found OFF ) endif ( ) diff --git a/CHOLMOD/Config/cholmod.h.in b/CHOLMOD/Config/cholmod.h.in index 31de0426d9..c442d17a1f 100644 --- a/CHOLMOD/Config/cholmod.h.in +++ b/CHOLMOD/Config/cholmod.h.in @@ -23,7 +23,7 @@ //------------------------------------------------------------------------------ // CHOLMOD consists of a set of Modules, each with their own Copyright and // license: either LGPL-2.1+ or GPL-2.0+. This cholmod.h file includes -// defintions of the CHOLMOD API for all Modules, and this cholmod.h file +// definitions of the CHOLMOD API for all Modules, and this cholmod.h file // itself is provided to you with a permissive license (Apache-2.0). You are // permitted to provide the hooks for an optional interface to CHOLMOD in a // non-GPL/non-LGPL code, without requiring you to agree to the GPL/LGPL @@ -32,6 +32,12 @@ // GPL or LGPL licenses are used, or if you obtain a different license from the // respective copyright holders. // +// For the files in CHOLMOD/Include: +// CHOLMOD/Include/cholmod.h SPDX-License-Identifier: Apache-2.0 +// CHOLMOD/Include/cholmod_internal.h SPDX-License-Identifier: Apache-2.0 +// CHOLMOD/Include/cholmod_template.h SPDX-License-Identifier: Apache-2.0 +// CHOLMOD/Include/cholmod_types.h SPDX-License-Identifier: Apache-2.0 +// // The Modify Module is co-authored by William W. Hager. // // Acknowledgements: this work was supported in part by the National Science @@ -246,8 +252,7 @@ #define CHOLMOD_SUBSUB_VERSION @CHOLMOD_VERSION_SUB@ #define CHOLMOD_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define CHOLMOD_VERSION \ - CHOLMOD_VER_CODE(CHOLMOD_MAIN_VERSION,CHOLMOD_SUB_VERSION) +#define CHOLMOD_VERSION CHOLMOD_VER_CODE(@CHOLMOD_VERSION_MAJOR@,@CHOLMOD_VERSION_MINOR@) #define CHOLMOD_HAS_VERSION_FUNCTION #ifdef __cplusplus @@ -302,9 +307,10 @@ int cholmod_l_version (int version [3]) ; #include "SuiteSparse_config.h" -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "CHOLMOD @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ requires SuiteSparse_config 7.4 or later" +#define CHOLMOD__VERSION SUITESPARSE__VERCODE(@CHOLMOD_VERSION_MAJOR@,@CHOLMOD_VERSION_MINOR@,@CHOLMOD_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "CHOLMOD @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif //------------------------------------------------------------------------------ @@ -690,8 +696,8 @@ typedef struct cholmod_common_struct size_t iworksize ; // size of Iwork, in Ints (int32 or int64). // This is at most 6*nrow + ncol. size_t xworkbytes ; // size of Xwork, in bytes. - // NOTE: in CHOLMOD v4 and earlier, xworkwise was in terms - // of # of doubles, not # of bytes. + // NOTE: in CHOLMOD v4 and earlier, this variable was called xworksize, + // and was in terms of # of doubles, not # of bytes. void *Flag ; // size nrow. If this is "cleared" then // Flag [i] < mark for all i = 0:nrow-1. Flag is kept cleared between diff --git a/CHOLMOD/Doc/CHOLMOD_UserGuide.pdf b/CHOLMOD/Doc/CHOLMOD_UserGuide.pdf index 46174736a1..3e2ed52e66 100644 Binary files a/CHOLMOD/Doc/CHOLMOD_UserGuide.pdf and b/CHOLMOD/Doc/CHOLMOD_UserGuide.pdf differ diff --git a/CHOLMOD/Doc/CHOLMOD_UserGuide.tex b/CHOLMOD/Doc/CHOLMOD_UserGuide.tex index 4f1f79390e..1422c9e0a4 100644 --- a/CHOLMOD/Doc/CHOLMOD_UserGuide.tex +++ b/CHOLMOD/Doc/CHOLMOD_UserGuide.tex @@ -287,9 +287,16 @@ \section{Single-precision sparse matrix support} \item {\tt SuiteSparse\_config}: a single place where all sparse matrix packages authored or co-authored by Davis are configured. \item {\tt METIS 5.1.0}: a graph partitioning package by George Karypis, - Univ. of Minnesota. A slightly revised copy appears in - {\tt CHOLMOD/SuiteSparse\_metis}. Not needed if {\tt -DNPARTITION} is - used. See http://www-users.cs.umn.edu/$\sim$karypis/metis. + Univ. of Minnesota. A slightly revised copy appears in {\tt + CHOLMOD/SuiteSparse\_metis}, but with a revised namespace so that no METIS + functions in CHOLMOD conflict with the unmodified METIS. SuiteSparse + cannot use any other METIS library except for {\tt + CHOLMOD/SuiteSparse\_metis}. There is no conflict with the unmodified + METIS, so it can be linked into the user's application alongside {\tt + CHOLMOD/SuiteSparse\_metis}. This folder containing the modified METIS is + not needed if {\tt -DNPARTITION} is used. See + http://www-users.cs.umn.edu/$\sim$karypis/metis for the original version of + METIS. \end{itemize} Three other packages are required for optimal performance: @@ -303,7 +310,7 @@ \section{Single-precision sparse matrix support} Not needed if {\tt -DNSUPERNODAL} is used. See http://www.netlib.org. \item CUDA BLAS: CHOLMOD can exploit an NVIDIA GPU by using the CUDA BLAS - for large supernodes. This feature is new to CHOLMOD v2.0.0. + for large supernodes. \end{itemize} You must first obtain and install LAPACK, and the BLAS. @@ -325,7 +332,7 @@ \section{Single-precision sparse matrix support} \item {\tt -DNPRINT}: do not print anything. \end{itemize} -These settings are controlled in cmake by the following variables, which +These settings are controlled in cmake by the following variables, which are all \verb'ON' by default: \begin{itemize} \item \verb'CHOLMOD_CHECK': if \verb'OFF': do not use the Check module. @@ -2016,9 +2023,16 @@ \subsection{{\tt cholmod\_sparse\_xtype}: change sparse xtype} %--------------------------------------- \input{_sparse_xtype.tex} -Changes the {\tt xtype} and/or \verb'dtype' of a sparse matrix, to pattern, -real, complex, or zomplex. Changing from complex or zomplex to real discards -the imaginary part. +Changes the {\tt xtype} and/or \verb'dtype' of a sparse matrix. The +\verb'xtype' can be changed to pattern, real, complex, or zomplex. The +\verb'dtype' can be changed to single or double. Changing from complex or +zomplex to real discards the imaginary part. + +The name of this method derives from an earlier version of CHOLMOD where all +matrices had an implied \verb'dtype' of \verb'CHOLMOD_DOUBLE'. The method now +supports changes to the \verb'dtype'. For backward compatilibilty, the name of +this method has not changed, and the \verb'to_xdtype' parameter values of the +prior versions are upwards compatible with this version of CHOLMOD. %------------------------------------------------------------------------------- \newpage \section{{\tt Utility} Module: {\tt cholmod\_factor} object} @@ -2168,10 +2182,11 @@ \subsection{{\tt cholmod\_change\_factor}: change factor} Supports all xtypes, except that there is no supernodal zomplex L. -The {\tt to\_xdtype} parameter is used only when converting from symbolic to +The \verb'to_xtype' parameter is used only when converting from symbolic to numeric or numeric to symbolic. It cannot be used to convert a numeric xtype -(real, complex, or zomplex) to a different numeric xtype. For that conversion, -use {\tt cholmod\_factor\_xtype} instead. +(real, complex, or zomplex) to a different numeric {\tt xtype}. It also cannot +change the \verb'dtype' of a factor (from double to single, for example). +For those conversions, use \verb'cholmod_factor_xtype' instead. %--------------------------------------- \subsection{{\tt cholmod\_pack\_factor}: pack the columns of a factor} @@ -2228,10 +2243,20 @@ \subsection{{\tt cholmod\_factor\_xtype}: change factor xtype} %--------------------------------------- \input{_factor_xtype.tex} -Changes the {\tt xtype} of a factor, to pattern, real, complex, or zomplex. -Changing from complex or zomplex to real discards the imaginary part. -You cannot change a supernodal factor to the zomplex xtype. - +Changes the {\tt xtype} and/or \verb'dtype' of a sparse factorization. The +\verb'xtype' can be changed to real, complex, or zomplex (not to pattern). +The \verb'dtype' can be changed to single or double. Changing from complex or +zomplex to real discards the imaginary part. +A supernodal factor cannot be changed to the zomplex \verb'xtype'. +A factor cannot be converted to an \verb'xtype' of pattern-only with this method; +use \verb'cholmod_change_factor' for that operation. + +The name of this method derives from an earlier version of CHOLMOD where all +matrices had an implied \verb'dtype' of \verb'CHOLMOD_DOUBLE'. The method now +supports changes to the \verb'dtype'. For backward compatilibilty, the name of +this method has not changed, and the \verb'to_xdtype' parameter values of the +prior versions are upwards compatible with this version of CHOLMOD. + %--------------------------------------- \subsection{How many entries are in a CHOLMOD sparse Cholesky factorization?} %--------------------------------------- @@ -2464,9 +2489,17 @@ \subsection{{\tt cholmod\_dense\_xtype}: change dense matrix xtype} %--------------------------------------- \input{_dense_xtype.tex} -Changes the {\tt xtype} and/or {\tt dtype} of a dense matrix, to real, complex, -or zomplex. Changing from complex or zomplex to real discards the imaginary -part. A dense matrix cannot be converted to an xtype of pattern-only. +Changes the {\tt xtype} and/or \verb'dtype' of a dense matrix. +The \verb'xtype' can change to real, complex, or zomplex (not pattern-only). +The \verb'dtype' can change to single or double. +Changing from complex or zomplex to real discards the imaginary part. +A dense matrix cannot be converted to an \verb'xtype' of pattern-only. + +The name of this method derives from an earlier version of CHOLMOD where all +matrices had an implied \verb'dtype' of \verb'CHOLMOD_DOUBLE'. The method now +supports changes to the \verb'dtype'. For backward compatilibilty, the name of +this method has not changed, and the \verb'to_xdtype' parameter values of the +prior versions are upwards compatible with this version of CHOLMOD. %------------------------------------------------------------------------------- \newpage \section{{\tt Utility} Module: {\tt cholmod\_triplet} object} @@ -2534,9 +2567,17 @@ \subsection{{\tt cholmod\_triplet\_xtype}: change triplet xtype} %--------------------------------------- \input{_triplet_xtype.tex} -Changes the {\tt xtype} of a dense matrix, to real, complex, or zomplex. +Changes the {\tt xtype} and/or \verb'dtype' of a triplet matrix. +The \verb'xtype' can change to pattern, real, complex, or zomplex, +and the \verb'dtype' can change to single or double. Changing from complex or zomplex to real discards the imaginary part. +The name of this method derives from an earlier version of CHOLMOD where all +matrices had an implied \verb'dtype' of \verb'CHOLMOD_DOUBLE'. The method now +supports changes to the \verb'dtype'. For backward compatilibilty, the name of +this method has not changed, and the \verb'to_xdtype' parameter values of the +prior versions are upwards compatible with this version of CHOLMOD. + %------------------------------------------------------------------------------- \newpage \section{{\tt Utility} Module: memory management} %------------------------------------------------------------------------------- @@ -3630,7 +3671,7 @@ \subsection{{\tt cholmod\_rowadd}: add row to factor} matrix on input. Only real matrices are supported (double or single). The dtypes of all matrices must match, except when \verb'L' is symbolic (with an xtype of \verb'CHOLMOD_PATTERN'). In this case, \verb'L' is converted to the -dtype of \verb'R'. The algorithm is described in \cite{DavisHager05}. +dtype of \verb'R'. The algorithm is described in \cite{DavisHager05}. %--------------------------------------- \subsection{{\tt cholmod\_rowadd\_solve}: add row to factor and update a diff --git a/CHOLMOD/Doc/ChangeLog b/CHOLMOD/Doc/ChangeLog index 6de63c3d75..2b988e0e71 100644 --- a/CHOLMOD/Doc/ChangeLog +++ b/CHOLMOD/Doc/ChangeLog @@ -1,3 +1,8 @@ +Jan 10, 2024: version 5.1.1 + + * MATLAB interface: add -DNO_SSIZE_T for Windows + * minor updates to build system + Dec 30, 2023: version 5.1.0 * major change to build system: by Markus Mützel diff --git a/CHOLMOD/Doc/cholmod_version.tex b/CHOLMOD/Doc/cholmod_version.tex index 557d77e60a..237030def3 100644 --- a/CHOLMOD/Doc/cholmod_version.tex +++ b/CHOLMOD/Doc/cholmod_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/CHOLMOD -\date{VERSION 5.1.0, Dec 30, 2023} +\date{VERSION 5.1.1, Jan 10, 2024} diff --git a/CHOLMOD/GPU/cholmod_gpu.c b/CHOLMOD/GPU/cholmod_gpu.c index fe6f600105..2d4de05a52 100644 --- a/CHOLMOD/GPU/cholmod_gpu.c +++ b/CHOLMOD/GPU/cholmod_gpu.c @@ -500,7 +500,7 @@ int CHOLMOD(gpu_allocate) ( cholmod_common *Common ) return 0; } - CHOLMOD(gpu_deallocate); + CHOLMOD(gpu_deallocate) (Common); /* allocated corresponding pinned host memory */ requestedHostMemory = requestedDeviceMemory*CHOLMOD_HOST_SUPERNODE_BUFFERS/ diff --git a/CHOLMOD/GPU/t_cholmod_gpu.c b/CHOLMOD/GPU/t_cholmod_gpu.c index 977ad0760d..888515a49b 100644 --- a/CHOLMOD/GPU/t_cholmod_gpu.c +++ b/CHOLMOD/GPU/t_cholmod_gpu.c @@ -157,7 +157,7 @@ int TEMPLATE2 (CHOLMOD (gpu_init)) k*Common->devBuffSize); } - return (1); /* initialization successfull, useGPU = 1 */ + return (1); /* initialization successful, useGPU = 1 */ } diff --git a/CHOLMOD/Include/cholmod.h b/CHOLMOD/Include/cholmod.h index 0290f5ef50..1bc8a6c42f 100644 --- a/CHOLMOD/Include/cholmod.h +++ b/CHOLMOD/Include/cholmod.h @@ -23,7 +23,7 @@ //------------------------------------------------------------------------------ // CHOLMOD consists of a set of Modules, each with their own Copyright and // license: either LGPL-2.1+ or GPL-2.0+. This cholmod.h file includes -// defintions of the CHOLMOD API for all Modules, and this cholmod.h file +// definitions of the CHOLMOD API for all Modules, and this cholmod.h file // itself is provided to you with a permissive license (Apache-2.0). You are // permitted to provide the hooks for an optional interface to CHOLMOD in a // non-GPL/non-LGPL code, without requiring you to agree to the GPL/LGPL @@ -32,6 +32,12 @@ // GPL or LGPL licenses are used, or if you obtain a different license from the // respective copyright holders. // +// For the files in CHOLMOD/Include: +// CHOLMOD/Include/cholmod.h SPDX-License-Identifier: Apache-2.0 +// CHOLMOD/Include/cholmod_internal.h SPDX-License-Identifier: Apache-2.0 +// CHOLMOD/Include/cholmod_template.h SPDX-License-Identifier: Apache-2.0 +// CHOLMOD/Include/cholmod_types.h SPDX-License-Identifier: Apache-2.0 +// // The Modify Module is co-authored by William W. Hager. // // Acknowledgements: this work was supported in part by the National Science @@ -240,14 +246,13 @@ // version control //------------------------------------------------------------------------------ -#define CHOLMOD_DATE "Dec 30, 2023" +#define CHOLMOD_DATE "Jan 10, 2024" #define CHOLMOD_MAIN_VERSION 5 #define CHOLMOD_SUB_VERSION 1 -#define CHOLMOD_SUBSUB_VERSION 0 +#define CHOLMOD_SUBSUB_VERSION 1 #define CHOLMOD_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define CHOLMOD_VERSION \ - CHOLMOD_VER_CODE(CHOLMOD_MAIN_VERSION,CHOLMOD_SUB_VERSION) +#define CHOLMOD_VERSION CHOLMOD_VER_CODE(5,1) #define CHOLMOD_HAS_VERSION_FUNCTION #ifdef __cplusplus @@ -302,9 +307,10 @@ int cholmod_l_version (int version [3]) ; #include "SuiteSparse_config.h" -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "CHOLMOD 5.1.0 requires SuiteSparse_config 7.4 or later" +#define CHOLMOD__VERSION SUITESPARSE__VERCODE(5,1,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "CHOLMOD 5.1.1 requires SuiteSparse_config 7.5.0 or later" #endif //------------------------------------------------------------------------------ @@ -690,8 +696,8 @@ typedef struct cholmod_common_struct size_t iworksize ; // size of Iwork, in Ints (int32 or int64). // This is at most 6*nrow + ncol. size_t xworkbytes ; // size of Xwork, in bytes. - // NOTE: in CHOLMOD v4 and earlier, xworkwise was in terms - // of # of doubles, not # of bytes. + // NOTE: in CHOLMOD v4 and earlier, this variable was called xworksize, + // and was in terms of # of doubles, not # of bytes. void *Flag ; // size nrow. If this is "cleared" then // Flag [i] < mark for all i = 0:nrow-1. Flag is kept cleared between diff --git a/CHOLMOD/MATLAB/cholmod_make.m b/CHOLMOD/MATLAB/cholmod_make.m index ad75ccf116..522c50303b 100644 --- a/CHOLMOD/MATLAB/cholmod_make.m +++ b/CHOLMOD/MATLAB/cholmod_make.m @@ -21,37 +21,29 @@ details = 0 ; % 1 if details of each command are to be printed -v = version ; -try - % ispc does not appear in MATLAB 5.3 - pc = ispc ; - mac = ismac ; -catch - % if ispc fails, assume we are on a Windows PC if it's not unix - pc = ~isunix ; - mac = 0 ; -end - % -R2018a: interleaved complex is required flags = '-O -R2018a -silent ' ; +if (ispc) + % MSVC does not define ssize_t + flags = [flags ' -DNO_SSIZE_T'] ; +end + include = '-I. -I.. -I../../AMD/Include -I../../COLAMD/Include -I../../CCOLAMD/Include -I../../CAMD/Include -I../Include -I../../SuiteSparse_config' ; -if (~pc) +if (~ispc) % Linux/Unix require these flags for large file support include = [include ' -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE'] ; end % Determine if METIS is available -have_metis = exist ('../SuiteSparse_metis', 'dir') ; - -if (have_metis) - fprintf ('Compiling CHOLMOD with METIS for MATLAB Version %s\n', v) ; +if (exist ('../SuiteSparse_metis', 'dir')) + fprintf ('Compiling CHOLMOD with METIS for MATLAB Version %s\n', version) ; include = [include ' -I../SuiteSparse_metis/include'] ; include = [include ' -I../SuiteSparse_metis/GKlib'] ; include = [include ' -I../SuiteSparse_metis/libmetis'] ; else - fprintf ('Compiling CHOLMOD without METIS for MATLAB Version %s\n', v) ; + fprintf ('Compiling CHOLMOD without METIS for MATLAB Version %s\n', version) ; include = ['-DNPARTITION ' include] ; end @@ -59,10 +51,7 @@ % BLAS option %--------------------------------------------------------------------------- - % This is exceedingly ugly. The MATLAB mex command needs to be told where to - % find the LAPACK and BLAS libraries, which is a real portability nightmare. - -if (pc) +if (ispc) % BLAS/LAPACK functions have no underscore on Windows flags = [flags ' -DBLAS_NO_UNDERSCORE'] ; if (verLessThan ('matlab', '9.5')) @@ -79,7 +68,7 @@ % using the 64-bit BLAS flags = [flags ' -DBLAS64'] ; -if (~(pc || mac)) +if (~(ispc || ismac)) % for POSIX timing routine lapack = [lapack ' -lrt'] ; end @@ -247,7 +236,7 @@ 'mwrite', ... 'lxbpattern', 'lsubsolve' } ; % <=== these 2 are just for testing -if (pc) +if (ispc) obj_extension = '.obj' ; else obj_extension = '.o' ; diff --git a/CHOLMOD/Partition/cholmod_camd.c b/CHOLMOD/Partition/cholmod_camd.c index 77ea1f00b5..aefd4d57e5 100644 --- a/CHOLMOD/Partition/cholmod_camd.c +++ b/CHOLMOD/Partition/cholmod_camd.c @@ -35,7 +35,7 @@ #include "camd.h" #if (CAMD_VERSION < CAMD_VERSION_CODE (3,3)) -#error "CHOLMOD:Partition requires CAMD 3.3.0 or later" +#error "CHOLMOD:Partition requires CAMD 3.3.1 or later" #endif //------------------------------------------------------------------------------ diff --git a/CHOLMOD/Partition/cholmod_ccolamd.c b/CHOLMOD/Partition/cholmod_ccolamd.c index 06848d52b0..0ebe7f04b9 100644 --- a/CHOLMOD/Partition/cholmod_ccolamd.c +++ b/CHOLMOD/Partition/cholmod_ccolamd.c @@ -25,7 +25,7 @@ #include "ccolamd.h" #if (CCOLAMD_VERSION < CCOLAMD_VERSION_CODE (3,3)) -#error "CHOLMOD:Partition requires CCOLAMD 3.3.0 or later" +#error "CHOLMOD:Partition requires CCOLAMD 3.3.1 or later" #endif //------------------------------------------------------------------------------ diff --git a/CHOLMOD/Partition/cholmod_csymamd.c b/CHOLMOD/Partition/cholmod_csymamd.c index ba81e9a8f6..376be5fb8a 100644 --- a/CHOLMOD/Partition/cholmod_csymamd.c +++ b/CHOLMOD/Partition/cholmod_csymamd.c @@ -24,7 +24,7 @@ #include "ccolamd.h" #if (CCOLAMD_VERSION < CCOLAMD_VERSION_CODE (3,3)) -#error "CHOLMOD:Partition requires CCOLAMD 3.3.0 or later" +#error "CHOLMOD:Partition requires CCOLAMD 3.3.1 or later" #endif //------------------------------------------------------------------------------ diff --git a/CMakeLists.txt b/CMakeLists.txt index 01de6b46db..d341fbafc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # SuiteSparse/CMakeLists.txt: root CMake build rules #------------------------------------------------------------------------------- -# Copyright (c) 2023, Timothy A. Davis, All Rights Reserved. +# Copyright (c) 2023-2024, Timothy A. Davis, All Rights Reserved. # Just this particular file is under the Apache-2.0 license; each package has # its own license. # SPDX-License-Identifier: Apache-2.0 @@ -110,7 +110,7 @@ include ( SuiteSparsePolicy ) if ( SUITESPARSE_USE_SYSTEM_GRAPHBLAS ) list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "graphblas" ) - find_package ( GraphBLAS 8.3.1 REQUIRED ) + find_package ( GraphBLAS 9.0.0 REQUIRED ) else ( ) if ( "lagraph" IN_LIST SUITESPARSE_ENABLE_PROJECTS ) # LAGraph requires GraphBLAS. @@ -123,7 +123,7 @@ endif ( ) if ( SUITESPARSE_USE_SYSTEM_BTF ) list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "btf" ) - find_package ( BTF 2.3.0 REQUIRED ) + find_package ( BTF 2.3.1 REQUIRED ) else ( ) if ( "klu" IN_LIST SUITESPARSE_ENABLE_PROJECTS ) # KLU requires BTF. @@ -136,7 +136,7 @@ endif ( ) if ( SUITESPARSE_USE_SYSTEM_CHOLMOD ) list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "cholmod" ) - find_package ( CHOLMOD 5.1.0 REQUIRED ) + find_package ( CHOLMOD 5.1.1 REQUIRED ) else ( ) if ( ( KLU_USE_CHOLMOD AND "klu" IN_LIST SUITESPARSE_ENABLE_PROJECTS ) OR ( UMFPACK_USE_CHOLMOD AND "umfpack" IN_LIST SUITESPARSE_ENABLE_PROJECTS ) @@ -154,7 +154,7 @@ endif ( ) if ( SUITESPARSE_USE_SYSTEM_AMD ) list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "amd" ) - find_package ( AMD 3.3.0 REQUIRED ) + find_package ( AMD 3.3.1 REQUIRED ) else ( ) if ( "cholmod" IN_LIST SUITESPARSE_ENABLE_PROJECTS OR "ldl" IN_LIST SUITESPARSE_ENABLE_PROJECTS @@ -170,7 +170,7 @@ endif ( ) if ( SUITESPARSE_USE_SYSTEM_COLAMD ) list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "colamd" ) - find_package ( COLAMD 3.3.0 REQUIRED ) + find_package ( COLAMD 3.3.1 REQUIRED ) else ( ) if ( "cholmod" IN_LIST SUITESPARSE_ENABLE_PROJECTS OR "spex" IN_LIST SUITESPARSE_ENABLE_PROJECTS ) @@ -184,7 +184,7 @@ endif ( ) if ( SUITESPARSE_USE_SYSTEM_CAMD ) list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "camd" ) - find_package ( CAMD 3.3.0 REQUIRED ) + find_package ( CAMD 3.3.1 REQUIRED ) else ( ) if ( CHOLMOD_CAMD AND "cholmod" IN_LIST SUITESPARSE_ENABLE_PROJECTS ) # CHOLMOD can optionally use CAMD. @@ -197,7 +197,7 @@ endif ( ) if ( SUITESPARSE_USE_SYSTEM_CCOLAMD ) list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "ccolamd" ) - find_package ( CCOLAMD 3.3.0 REQUIRED ) + find_package ( CCOLAMD 3.3.1 REQUIRED ) else ( ) if ( CHOLMOD_CAMD AND "cholmod" IN_LIST SUITESPARSE_ENABLE_PROJECTS ) # CHOLMOD can optionally use CCOLAMD. @@ -210,7 +210,7 @@ endif ( ) if ( SUITESPARSE_USE_SYSTEM_SUITESPARSE_CONFIG ) list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "suitesparse_config" ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) else ( ) if ( "mongoose" IN_LIST SUITESPARSE_ENABLE_PROJECTS OR "amd" IN_LIST SUITESPARSE_ENABLE_PROJECTS @@ -235,6 +235,23 @@ else ( ) endif ( ) endif ( ) + +if ( CMAKE_VERSION VERSION_LESS 3.24 ) + # work around missing GLOBAL option of find_package in older CMake versions + # If SuiteSparse is included as a sub-project in other projects, they might + # need to manually import the OpenMP targets for older CMake versions, too. + if ( "suitesparse_config" IN_LIST SUITESPARSE_ENABLE_PROJECTS + OR "cholmod" IN_LIST SUITESPARSE_ENABLE_PROJECTS + OR "graphblas" IN_LIST SUITESPARSE_ENABLE_PROJECTS + OR "paru" IN_LIST SUITESPARSE_ENABLE_PROJECTS ) + find_package ( OpenMP COMPONENTS C ) + endif ( ) + if ( "paru" IN_LIST SUITESPARSE_ENABLE_PROJECTS ) + find_package ( OpenMP COMPONENTS CXX ) + endif ( ) +endif ( ) + + #------------------------------------------------------------------------------- # include selected projects #------------------------------------------------------------------------------- diff --git a/COLAMD/CMakeLists.txt b/COLAMD/CMakeLists.txt index ca12c2bf65..f040b81bbe 100644 --- a/COLAMD/CMakeLists.txt +++ b/COLAMD/CMakeLists.txt @@ -2,7 +2,7 @@ # SuiteSparse/COLAMD/CMakeLists.txt: cmake for COLAMD #------------------------------------------------------------------------------- -# Copyright (c) 1998-2023, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 1998-2024, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- @@ -11,10 +11,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( COLAMD_DATE "Dec 30, 2023" ) +set ( COLAMD_DATE "Jan 10, 2024" ) set ( COLAMD_VERSION_MAJOR 3 CACHE STRING "" FORCE ) set ( COLAMD_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( COLAMD_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( COLAMD_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building COLAMD version: v" ${COLAMD_VERSION_MAJOR}. @@ -43,10 +43,10 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) endif ( ) diff --git a/COLAMD/Config/colamd.h.in b/COLAMD/Config/colamd.h.in index 9740501a59..3b751af808 100644 --- a/COLAMD/Config/colamd.h.in +++ b/COLAMD/Config/colamd.h.in @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// COLAMD/Source/colamd.h: include file for COLAMD +// COLAMD/Include/colamd.h: include file for COLAMD //------------------------------------------------------------------------------ -// COLAMD, Copyright (c) 1998-2023, Timothy A. Davis and Stefan Larimore, +// COLAMD, Copyright (c) 1998-2024, Timothy A. Davis and Stefan Larimore, // All Rights Reserved. // SPDX-License-Identifier: BSD-3-clause @@ -71,12 +71,12 @@ #define COLAMD_SUBSUB_VERSION @COLAMD_VERSION_SUB@ #define COLAMD_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define COLAMD_VERSION \ - COLAMD_VERSION_CODE(COLAMD_MAIN_VERSION,COLAMD_SUB_VERSION) +#define COLAMD_VERSION COLAMD_VERSION_CODE(@COLAMD_VERSION_MAJOR@,@COLAMD_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "COLAMD @COLAMD_VERSION_MAJOR@.@COLAMD_VERSION_MINOR@.@COLAMD_VERSION_SUB@ requires SuiteSparse_config 7.4 or later" +#define COLAMD__VERSION SUITESPARSE__VERCODE(@COLAMD_VERSION_MAJOR@,@COLAMD_VERSION_MINOR@,@COLAMD_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "COLAMD @COLAMD_VERSION_MAJOR@.@COLAMD_VERSION_MINOR@.@COLAMD_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif /* ========================================================================== */ diff --git a/COLAMD/Demo/colamd_example.out b/COLAMD/Demo/colamd_example.out index 04e46e0220..1d718669af 100644 --- a/COLAMD/Demo/colamd_example.out +++ b/COLAMD/Demo/colamd_example.out @@ -1,4 +1,4 @@ -COLAMD v3.3.0 +COLAMD v3.3.1 colamd 5-by-4 input matrix: Column 0, with 3 entries: row 0 @@ -16,7 +16,7 @@ Column 3, with 2 entries: row 1 row 3 -colamd version 3.3.0, Dec 30, 2023: OK. +colamd version 3.3.1, Jan 10, 2024: OK. colamd: number of dense or empty rows ignored: 0 colamd: number of dense or empty columns ignored: 0 colamd: number of garbage collections performed: 0 @@ -39,7 +39,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -symamd version 3.3.0, Dec 30, 2023: OK. +symamd version 3.3.1, Jan 10, 2024: OK. symamd: number of dense or empty rows ignored: 0 symamd: number of dense or empty columns ignored: 0 symamd: number of garbage collections performed: 0 diff --git a/COLAMD/Demo/colamd_l_example.out b/COLAMD/Demo/colamd_l_example.out index a284430c49..f51103899b 100644 --- a/COLAMD/Demo/colamd_l_example.out +++ b/COLAMD/Demo/colamd_l_example.out @@ -1,4 +1,4 @@ -COLAMD v3.3.0 +COLAMD v3.3.1 colamd 5-by-4 input matrix: Column 0, with 3 entries: row 0 @@ -16,7 +16,7 @@ Column 3, with 2 entries: row 1 row 3 -colamd version 3.3.0, Dec 30, 2023: OK. +colamd version 3.3.1, Jan 10, 2024: OK. colamd: number of dense or empty rows ignored: 0 colamd: number of dense or empty columns ignored: 0 colamd: number of garbage collections performed: 0 @@ -39,7 +39,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -symamd version 3.3.0, Dec 30, 2023: OK. +symamd version 3.3.1, Jan 10, 2024: OK. symamd: number of dense or empty rows ignored: 0 symamd: number of dense or empty columns ignored: 0 symamd: number of garbage collections performed: 0 diff --git a/COLAMD/Doc/ChangeLog b/COLAMD/Doc/ChangeLog index 778aac9cd0..65d4e55aa8 100644 --- a/COLAMD/Doc/ChangeLog +++ b/COLAMD/Doc/ChangeLog @@ -1,3 +1,7 @@ +Jan 10, 2024: version 3.3.1 + + * minor updates to build system + Dec 30, 2023: version 3.3.0 * major change to build system: by Markus Mützel diff --git a/COLAMD/Include/colamd.h b/COLAMD/Include/colamd.h index 2ced537886..adea8c314a 100644 --- a/COLAMD/Include/colamd.h +++ b/COLAMD/Include/colamd.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// COLAMD/Source/colamd.h: include file for COLAMD +// COLAMD/Include/colamd.h: include file for COLAMD //------------------------------------------------------------------------------ -// COLAMD, Copyright (c) 1998-2023, Timothy A. Davis and Stefan Larimore, +// COLAMD, Copyright (c) 1998-2024, Timothy A. Davis and Stefan Larimore, // All Rights Reserved. // SPDX-License-Identifier: BSD-3-clause @@ -65,18 +65,18 @@ * Versions 2.3 and earlier of COLAMD do not include a #define'd version number. */ -#define COLAMD_DATE "Dec 30, 2023" +#define COLAMD_DATE "Jan 10, 2024" #define COLAMD_MAIN_VERSION 3 #define COLAMD_SUB_VERSION 3 -#define COLAMD_SUBSUB_VERSION 0 +#define COLAMD_SUBSUB_VERSION 1 #define COLAMD_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define COLAMD_VERSION \ - COLAMD_VERSION_CODE(COLAMD_MAIN_VERSION,COLAMD_SUB_VERSION) +#define COLAMD_VERSION COLAMD_VERSION_CODE(3,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "COLAMD 3.3.0 requires SuiteSparse_config 7.4 or later" +#define COLAMD__VERSION SUITESPARSE__VERCODE(3,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "COLAMD 3.3.1 requires SuiteSparse_config 7.5.0 or later" #endif /* ========================================================================== */ diff --git a/COLAMD/Makefile b/COLAMD/Makefile index 729ec183ed..8c541b1d8f 100644 --- a/COLAMD/Makefile +++ b/COLAMD/Makefile @@ -53,10 +53,10 @@ all: library demos: library ( cd build && cmake $(CMAKE_OPTIONS) -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j${JOBS} ) - - ./build/colamd_example > ./build/colamd_example.out - - diff --strip-trailing-cr ./Demo/colamd_example.out ./build/colamd_example.out - - ./build/colamd_l_example > ./build/colamd_l_example.out - - diff --strip-trailing-cr ./Demo/colamd_l_example.out ./build/colamd_l_example.out + - ./build/colamd_example > ./build/colamd_example.out && ( command -v d2u && d2u ./build/colamd_example.out || true ) + - diff ./Demo/colamd_example.out ./build/colamd_example.out + - ./build/colamd_l_example > ./build/colamd_l_example.out && ( command -v d2u && d2u ./build/colamd_l_example.out || true ) + - diff ./Demo/colamd_l_example.out ./build/colamd_l_example.out # just compile after running cmake; do not run cmake again remake: diff --git a/CXSparse/CMakeLists.txt b/CXSparse/CMakeLists.txt index add24c6abe..141e4ee7c5 100644 --- a/CXSparse/CMakeLists.txt +++ b/CXSparse/CMakeLists.txt @@ -11,10 +11,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( CXSPARSE_DATE "Dec 30, 2023" ) +set ( CXSPARSE_DATE "Jan 10, 2024" ) set ( CXSPARSE_VERSION_MAJOR 4 CACHE STRING "" FORCE ) set ( CXSPARSE_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( CXSPARSE_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( CXSPARSE_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building CXSparse version: v" ${CXSPARSE_VERSION_MAJOR}. @@ -70,10 +70,10 @@ endif ( ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) endif ( ) diff --git a/CXSparse/Config/cs.h.in b/CXSparse/Config/cs.h.in index 46b0f4d031..7cb7cec329 100644 --- a/CXSparse/Config/cs.h.in +++ b/CXSparse/Config/cs.h.in @@ -2,7 +2,7 @@ // CXSparse/Include/cs.h: include file for CXSparse //------------------------------------------------------------------------------ -// CXSparse, Copyright (c) 2006-2023, Timothy A. Davis, All Rights Reserved +// CXSparse, Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved // SPDX-License-Identifier: LGPL-2.1+ //------------------------------------------------------------------------------ @@ -39,14 +39,15 @@ #define CS_SUBVER @CXSPARSE_VERSION_MINOR@ #define CS_SUBSUB @CXSPARSE_VERSION_SUB@ #define CS_DATE "@CXSPARSE_DATE@" /* CXSparse release date */ -#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2023" +#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2024" #define CXSPARSE #include "SuiteSparse_config.h" -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "CXSparse @CXSPARSE_VERSION_MAJOR@.@CXSPARSE_VERSION_MINOR@.@CXSPARSE_VERSION_SUB@ requires SuiteSparse_config 7.4 or later" +#define CXSPARSE__VERSION SUITESPARSE__VERCODE(@CXSPARSE_VERSION_MAJOR@,@CXSPARSE_VERSION_MINOR@,@CXSPARSE_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "CXSparse @CXSPARSE_VERSION_MAJOR@.@CXSPARSE_VERSION_MINOR@.@CXSPARSE_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif #define cs_long_t int64_t diff --git a/CXSparse/Demo/cs_demo.out b/CXSparse/Demo/cs_demo.out index 8e289b7b71..0e109b67f6 100644 --- a/CXSparse/Demo/cs_demo.out +++ b/CXSparse/Demo/cs_demo.out @@ -1,66 +1,72 @@ -( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) --- Building CXSparse version: v4.3.0 (Dec 30, 2023) --- Source: /Users/davis/dev2/SuiteSparse/CXSparse --- Build: /Users/davis/dev2/SuiteSparse/CXSparse/build --- Install lib: lib --- Install include: include --- Install bin: bin --- Install pkg-file: lib --- Install rpath: --- Build rpath: /Users/davis/dev2/SuiteSparse/CXSparse/build --- Build type: Release --- Fortran: /opt/homebrew/bin/gfortran --- CUDA: not enabled +( cd build && cmake -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j8 ) +-- Building CXSparse version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled -- complex data type: enabled --- SuiteSparse_config version: 7.4.0 --- SuiteSparse_config include: /Users/davis/dev2/SuiteSparse/SuiteSparse_config --- SuiteSparse_config library: /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.7.4.0.dylib --- SuiteSparse_config static: /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- SuiteSparse_config version: 7.5.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.5.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a -- Also compiling the demos in CXSparse/Demo -- ------------------------------------------------------------------------ --- SuiteSparse CMAKE report for: cxsparse +-- SuiteSparse CMAKE report for: CXSparse -- ------------------------------------------------------------------------ --- inside common SuiteSparse root: false --- install in SuiteSparse/lib and SuiteSparse/include: OFF +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 -- build type: Release -- BUILD_SHARED_LIBS: ON -- BUILD_STATIC_LIBS: ON --- use OpenMP: no --- C compiler: /Library/Developer/CommandLineTools/usr/bin/cc +-- C compiler: /usr/bin/cc -- C flags: -- C++ compiler: -- C++ flags: -- C Flags release: -O3 -DNDEBUG -- C++ Flags release: --- Fortran compiler: /opt/homebrew/bin/gfortran +-- Fortran compiler: /usr/bin/f95 -- compile definitions: +-- CUDA architectures: 52;75;80 -- ------------------------------------------------------------------------ --- Configuring done (0.0s) +-- Configuring done (0.6s) -- Generating done (0.1s) --- Build files have been written to: /Users/davis/dev2/SuiteSparse/CXSparse/build -[ 82%] Built target CXSparse +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' +[ 44%] Built target CXSparse [ 89%] Built target CXSparse_static -[ 89%] Built target cs_di_demo1 -[ 90%] Built target cs_di_demo2 -[ 90%] Built target cs_demo1 +[ 90%] Built target cs_demo2 +[ 90%] Built target cs_di_demo1 [ 91%] Built target cs_demo3 -[ 92%] Built target cs_dl_demo2 -[ 94%] Built target cs_di_demo3 -[ 94%] Built target cs_demo2 -[ 94%] Built target cs_dl_demo1 +[ 92%] Built target cs_di_demo2 +[ 92%] Built target cs_demo1 +[ 93%] Built target cs_di_demo3 +[ 93%] Built target cs_dl_demo1 +[ 94%] Built target cs_dl_demo2 [ 95%] Built target cs_dl_demo3 -[ 95%] Built target cs_ci_demo2 -[ 96%] Built target cs_ci_demo3 -[ 97%] Built target cs_cl_demo3 -[ 98%] Built target cs_ci_demo1 +[ 96%] Built target cs_ci_demo1 +[ 97%] Built target cs_cl_demo1 +[ 97%] Built target cs_ci_demo2 +[ 98%] Built target cs_ci_demo3 [ 98%] Built target cs_cl_demo2 -[ 99%] Built target cs_cl_demo1 +[ 99%] Built target cs_cl_demo3 [ 99%] Built target cs_idemo [100%] Built target cs_ldemo +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' ./build/cs_demo1 < Matrix/t1 -CXSparse v4.3.0 +CXSparse v4.3.1 T: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -73,7 +79,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : 4.5 2 1 : 1.7 A: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -90,7 +96,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 3 : 1 1 : 0.9 AT: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 col 0 : locations 0 to 1 0 : 4.5 @@ -107,7 +113,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : 0.4 3 : 1 D: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 col 0 : locations 0 to 3 1 : 13.95 @@ -133,40 +139,40 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 --- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.11e+01 blocks: 1 singletons: 0 structural rank: 4 -QR natural time: 0.00 resid: 2.87e-17 -QR amd(A'*A) time: 0.00 resid: 1.04e-17 -LU natural time: 0.00 resid: 1.04e-17 -LU amd(A+A') time: 0.00 resid: 4.94e-18 -LU amd(S'*S) time: 0.00 resid: 4.94e-18 -LU amd(A'*A) time: 0.00 resid: 4.94e-18 +QR natural time: 0.00 resid: 3.06e-17 +QR amd(A'*A) time: 0.00 resid: 2.30e-17 +LU natural time: 0.00 resid: 1.53e-17 +LU amd(A+A') time: 0.00 resid: 1.53e-17 +LU amd(S'*S) time: 0.00 resid: 0.00e+00 +LU amd(A'*A) time: 0.00 resid: 1.53e-17 ./build/cs_demo2 < Matrix/fs_183_1 --- Matrix: 183-by-183, nnz: 988 (sym: 0: nnz 0), norm: 1.70e+09 zero entries dropped: 71 tiny entries dropped: 10 blocks: 38 singletons: 37 structural rank: 183 -QR natural time: 0.00 resid: 1.16e-27 -QR amd(A'*A) time: 0.00 resid: 6.82e-28 -LU natural time: 0.00 resid: 4.65e-28 -LU amd(A+A') time: 0.00 resid: 1.51e-27 -LU amd(S'*S) time: 0.00 resid: 7.82e-28 -LU amd(A'*A) time: 0.00 resid: 7.82e-28 +QR natural time: 0.00 resid: 1.42e-27 +QR amd(A'*A) time: 0.00 resid: 3.35e-28 +LU natural time: 0.00 resid: 6.20e-28 +LU amd(A+A') time: 0.00 resid: 1.55e-27 +LU amd(S'*S) time: 0.00 resid: 6.98e-28 +LU amd(A'*A) time: 0.00 resid: 6.98e-28 ./build/cs_demo2 < Matrix/west0067 --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 4.46e-17 -QR amd(A'*A) time: 0.00 resid: 5.76e-17 -LU natural time: 0.00 resid: 2.18e-17 -LU amd(A+A') time: 0.00 resid: 2.90e-17 -LU amd(S'*S) time: 0.00 resid: 2.20e-17 -LU amd(A'*A) time: 0.00 resid: 2.20e-17 +QR natural time: 0.00 resid: 5.19e-17 +QR amd(A'*A) time: 0.00 resid: 3.25e-17 +LU natural time: 0.00 resid: 3.89e-17 +LU amd(A+A') time: 0.00 resid: 2.27e-17 +LU amd(S'*S) time: 0.00 resid: 1.95e-17 +LU amd(A'*A) time: 0.00 resid: 2.60e-17 ./build/cs_demo2 < Matrix/lp_afiro --- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 blocks: 1 singletons: 0 structural rank: 27 -QR natural time: 0.00 resid: 1.71e-16 -QR amd(A'*A) time: 0.00 resid: 9.63e-17 +QR natural time: 0.00 resid: 3.85e-16 +QR amd(A'*A) time: 0.00 resid: 1.50e-16 ./build/cs_demo2 < Matrix/ash219 --- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 @@ -177,20 +183,20 @@ QR amd(A'*A) time: 0.00 resid: 1.61e-02 --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.03 resid: nan -QR amd(A'*A) time: 0.04 resid: nan +QR natural time: 0.06 resid: nan +QR amd(A'*A) time: 0.08 resid: nan ./build/cs_demo2 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 blocks: 1 singletons: 0 structural rank: 48 -QR natural time: 0.00 resid: 3.01e-19 -QR amd(A'*A) time: 0.00 resid: 5.05e-19 -LU natural time: 0.00 resid: 2.63e-19 -LU amd(A+A') time: 0.00 resid: 8.21e-20 -LU amd(S'*S) time: 0.00 resid: 1.96e-19 -LU amd(A'*A) time: 0.00 resid: 1.96e-19 -Chol natural time: 0.00 resid: 2.03e-19 -Chol amd(A+A') time: 0.00 resid: 2.01e-19 +QR natural time: 0.00 resid: 3.65e-19 +QR amd(A'*A) time: 0.00 resid: 4.02e-19 +LU natural time: 0.00 resid: 2.17e-19 +LU amd(A+A') time: 0.00 resid: 1.87e-19 +LU amd(S'*S) time: 0.00 resid: 2.38e-19 +LU amd(A'*A) time: 0.00 resid: 2.38e-19 +Chol natural time: 0.00 resid: 2.64e-19 +Chol amd(A+A') time: 0.00 resid: 2.55e-19 ./build/cs_demo3 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 @@ -199,39 +205,39 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 2.01e-19 +original: resid: 2.55e-19 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 3.21e-18 -rechol: time: 0.00 (incl solve) resid: 3.07e-18 +update: time: 0.00 (incl solve) resid: 9.66e-19 +rechol: time: 0.00 (incl solve) resid: 1.55e-18 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 4.46e-17 +downdate: time: 0.00 (incl solve) resid: 3.74e-17 ./build/cs_demo2 < Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.38 resid: 1.79e-22 -LU amd(A+A') time: 0.17 resid: 1.07e-22 -LU amd(S'*S) time: 0.17 resid: 1.25e-22 -LU amd(A'*A) time: 0.17 resid: 1.91e-22 -Chol amd(A+A') time: 0.05 resid: 1.15e-22 +QR amd(A'*A) time: 0.61 resid: 2.01e-22 +LU amd(A+A') time: 0.32 resid: 1.10e-22 +LU amd(S'*S) time: 0.32 resid: 1.28e-22 +LU amd(A'*A) time: 0.33 resid: 1.78e-22 +Chol amd(A+A') time: 0.10 resid: 1.19e-22 ./build/cs_demo3 < Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 chol then update/downdate amd(A+A') -symbolic chol time 0.00 -numeric chol time 0.04 +symbolic chol time 0.01 +numeric chol time 0.09 solve chol time 0.00 -original: resid: 1.15e-22 +original: resid: 1.19e-22 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 1.31e-23 -rechol: time: 0.04 (incl solve) resid: 1.44e-23 +update: time: 0.00 (incl solve) resid: 1.12e-23 +rechol: time: 0.09 (incl solve) resid: 1.17e-23 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 1.25e-21 +downdate: time: 0.00 (incl solve) resid: 4.09e-22 ./build/cs_di_demo1 < Matrix/t1 -CXSparse v4.3.0 +CXSparse v4.3.1 T: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -244,7 +250,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : 4.5 2 1 : 1.7 A: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -261,7 +267,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 3 : 1 1 : 0.9 AT: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 col 0 : locations 0 to 1 0 : 4.5 @@ -278,7 +284,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : 0.4 3 : 1 D: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 col 0 : locations 0 to 3 1 : 13.95 @@ -304,40 +310,40 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 --- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.11e+01 blocks: 1 singletons: 0 structural rank: 4 -QR natural time: 0.00 resid: 2.87e-17 -QR amd(A'*A) time: 0.00 resid: 1.04e-17 -LU natural time: 0.00 resid: 1.04e-17 -LU amd(A+A') time: 0.00 resid: 4.94e-18 -LU amd(S'*S) time: 0.00 resid: 4.94e-18 -LU amd(A'*A) time: 0.00 resid: 4.94e-18 +QR natural time: 0.00 resid: 3.06e-17 +QR amd(A'*A) time: 0.00 resid: 2.30e-17 +LU natural time: 0.00 resid: 1.53e-17 +LU amd(A+A') time: 0.00 resid: 1.53e-17 +LU amd(S'*S) time: 0.00 resid: 0.00e+00 +LU amd(A'*A) time: 0.00 resid: 1.53e-17 ./build/cs_di_demo2 < Matrix/fs_183_1 --- Matrix: 183-by-183, nnz: 988 (sym: 0: nnz 0), norm: 1.70e+09 zero entries dropped: 71 tiny entries dropped: 10 blocks: 38 singletons: 37 structural rank: 183 -QR natural time: 0.00 resid: 1.16e-27 -QR amd(A'*A) time: 0.00 resid: 6.82e-28 -LU natural time: 0.00 resid: 4.65e-28 -LU amd(A+A') time: 0.00 resid: 1.51e-27 -LU amd(S'*S) time: 0.00 resid: 7.82e-28 -LU amd(A'*A) time: 0.00 resid: 7.82e-28 +QR natural time: 0.01 resid: 1.42e-27 +QR amd(A'*A) time: 0.00 resid: 3.35e-28 +LU natural time: 0.00 resid: 6.20e-28 +LU amd(A+A') time: 0.00 resid: 1.55e-27 +LU amd(S'*S) time: 0.00 resid: 6.98e-28 +LU amd(A'*A) time: 0.00 resid: 6.98e-28 ./build/cs_di_demo2 < Matrix/west0067 --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 4.46e-17 -QR amd(A'*A) time: 0.00 resid: 5.76e-17 -LU natural time: 0.00 resid: 2.18e-17 -LU amd(A+A') time: 0.00 resid: 2.90e-17 -LU amd(S'*S) time: 0.00 resid: 2.20e-17 -LU amd(A'*A) time: 0.00 resid: 2.20e-17 +QR natural time: 0.00 resid: 5.19e-17 +QR amd(A'*A) time: 0.00 resid: 3.25e-17 +LU natural time: 0.00 resid: 3.89e-17 +LU amd(A+A') time: 0.00 resid: 2.27e-17 +LU amd(S'*S) time: 0.00 resid: 1.95e-17 +LU amd(A'*A) time: 0.00 resid: 2.60e-17 ./build/cs_di_demo2 < Matrix/lp_afiro --- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 blocks: 1 singletons: 0 structural rank: 27 -QR natural time: 0.00 resid: 1.71e-16 -QR amd(A'*A) time: 0.00 resid: 9.63e-17 +QR natural time: 0.00 resid: 3.85e-16 +QR amd(A'*A) time: 0.00 resid: 1.50e-16 ./build/cs_di_demo2 < Matrix/ash219 --- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 @@ -348,20 +354,20 @@ QR amd(A'*A) time: 0.00 resid: 1.61e-02 --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.03 resid: nan -QR amd(A'*A) time: 0.04 resid: nan +QR natural time: 0.05 resid: nan +QR amd(A'*A) time: 0.06 resid: nan ./build/cs_di_demo2 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 blocks: 1 singletons: 0 structural rank: 48 -QR natural time: 0.00 resid: 3.01e-19 -QR amd(A'*A) time: 0.00 resid: 5.05e-19 -LU natural time: 0.00 resid: 2.63e-19 -LU amd(A+A') time: 0.00 resid: 8.21e-20 -LU amd(S'*S) time: 0.00 resid: 1.96e-19 -LU amd(A'*A) time: 0.00 resid: 1.96e-19 -Chol natural time: 0.00 resid: 2.03e-19 -Chol amd(A+A') time: 0.00 resid: 2.01e-19 +QR natural time: 0.00 resid: 3.65e-19 +QR amd(A'*A) time: 0.00 resid: 4.02e-19 +LU natural time: 0.00 resid: 2.17e-19 +LU amd(A+A') time: 0.00 resid: 1.87e-19 +LU amd(S'*S) time: 0.00 resid: 2.38e-19 +LU amd(A'*A) time: 0.00 resid: 2.38e-19 +Chol natural time: 0.00 resid: 2.64e-19 +Chol amd(A+A') time: 0.00 resid: 2.55e-19 ./build/cs_di_demo3 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 @@ -370,39 +376,39 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 2.01e-19 +original: resid: 2.55e-19 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 3.21e-18 -rechol: time: 0.00 (incl solve) resid: 3.07e-18 +update: time: 0.00 (incl solve) resid: 9.66e-19 +rechol: time: 0.00 (incl solve) resid: 1.55e-18 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 4.46e-17 +downdate: time: 0.00 (incl solve) resid: 3.74e-17 ./build/cs_di_demo2 < Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.38 resid: 1.79e-22 -LU amd(A+A') time: 0.17 resid: 1.07e-22 -LU amd(S'*S) time: 0.16 resid: 1.25e-22 -LU amd(A'*A) time: 0.17 resid: 1.91e-22 -Chol amd(A+A') time: 0.05 resid: 1.15e-22 +QR amd(A'*A) time: 0.62 resid: 2.01e-22 +LU amd(A+A') time: 0.32 resid: 1.10e-22 +LU amd(S'*S) time: 0.32 resid: 1.28e-22 +LU amd(A'*A) time: 0.34 resid: 1.78e-22 +Chol amd(A+A') time: 0.10 resid: 1.19e-22 ./build/cs_di_demo3 < Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 chol then update/downdate amd(A+A') -symbolic chol time 0.00 -numeric chol time 0.04 +symbolic chol time 0.01 +numeric chol time 0.09 solve chol time 0.00 -original: resid: 1.15e-22 +original: resid: 1.19e-22 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 1.31e-23 -rechol: time: 0.04 (incl solve) resid: 1.44e-23 +update: time: 0.00 (incl solve) resid: 1.12e-23 +rechol: time: 0.09 (incl solve) resid: 1.17e-23 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 1.25e-21 +downdate: time: 0.00 (incl solve) resid: 4.09e-22 ./build/cs_dl_demo1 < Matrix/t1 -CXSparse v4.3.0 +CXSparse v4.3.1 T: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -415,7 +421,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : 4.5 2 1 : 1.7 A: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -432,7 +438,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 3 : 1 1 : 0.9 AT: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 col 0 : locations 0 to 1 0 : 4.5 @@ -449,7 +455,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : 0.4 3 : 1 D: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 col 0 : locations 0 to 3 1 : 13.95 @@ -475,40 +481,40 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 --- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.11e+01 blocks: 1 singletons: 0 structural rank: 4 -QR natural time: 0.00 resid: 2.87e-17 -QR amd(A'*A) time: 0.00 resid: 1.04e-17 -LU natural time: 0.00 resid: 1.04e-17 -LU amd(A+A') time: 0.00 resid: 4.94e-18 -LU amd(S'*S) time: 0.00 resid: 4.94e-18 -LU amd(A'*A) time: 0.00 resid: 4.94e-18 +QR natural time: 0.00 resid: 3.06e-17 +QR amd(A'*A) time: 0.00 resid: 2.30e-17 +LU natural time: 0.00 resid: 1.53e-17 +LU amd(A+A') time: 0.00 resid: 1.53e-17 +LU amd(S'*S) time: 0.00 resid: 0.00e+00 +LU amd(A'*A) time: 0.00 resid: 1.53e-17 ./build/cs_dl_demo2 < Matrix/fs_183_1 --- Matrix: 183-by-183, nnz: 988 (sym: 0: nnz 0), norm: 1.70e+09 zero entries dropped: 71 tiny entries dropped: 10 blocks: 38 singletons: 37 structural rank: 183 -QR natural time: 0.00 resid: 1.16e-27 -QR amd(A'*A) time: 0.00 resid: 6.82e-28 -LU natural time: 0.00 resid: 4.65e-28 -LU amd(A+A') time: 0.00 resid: 1.51e-27 -LU amd(S'*S) time: 0.00 resid: 7.82e-28 -LU amd(A'*A) time: 0.00 resid: 7.82e-28 +QR natural time: 0.00 resid: 1.42e-27 +QR amd(A'*A) time: 0.00 resid: 3.35e-28 +LU natural time: 0.00 resid: 6.20e-28 +LU amd(A+A') time: 0.00 resid: 1.55e-27 +LU amd(S'*S) time: 0.00 resid: 6.98e-28 +LU amd(A'*A) time: 0.00 resid: 6.98e-28 ./build/cs_dl_demo2 < Matrix/west0067 --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 4.46e-17 -QR amd(A'*A) time: 0.00 resid: 5.76e-17 -LU natural time: 0.00 resid: 2.18e-17 -LU amd(A+A') time: 0.00 resid: 2.90e-17 -LU amd(S'*S) time: 0.00 resid: 2.20e-17 -LU amd(A'*A) time: 0.00 resid: 2.20e-17 +QR natural time: 0.00 resid: 5.19e-17 +QR amd(A'*A) time: 0.00 resid: 3.25e-17 +LU natural time: 0.00 resid: 3.89e-17 +LU amd(A+A') time: 0.00 resid: 2.27e-17 +LU amd(S'*S) time: 0.00 resid: 1.95e-17 +LU amd(A'*A) time: 0.00 resid: 2.60e-17 ./build/cs_dl_demo2 < Matrix/lp_afiro --- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 blocks: 1 singletons: 0 structural rank: 27 -QR natural time: 0.00 resid: 1.71e-16 -QR amd(A'*A) time: 0.00 resid: 9.63e-17 +QR natural time: 0.00 resid: 3.85e-16 +QR amd(A'*A) time: 0.00 resid: 1.50e-16 ./build/cs_dl_demo2 < Matrix/ash219 --- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 @@ -519,20 +525,20 @@ QR amd(A'*A) time: 0.00 resid: 1.61e-02 --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.03 resid: nan -QR amd(A'*A) time: 0.04 resid: nan +QR natural time: 0.06 resid: nan +QR amd(A'*A) time: 0.07 resid: nan ./build/cs_dl_demo2 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 blocks: 1 singletons: 0 structural rank: 48 -QR natural time: 0.00 resid: 3.01e-19 -QR amd(A'*A) time: 0.00 resid: 5.05e-19 -LU natural time: 0.00 resid: 2.63e-19 -LU amd(A+A') time: 0.00 resid: 8.21e-20 -LU amd(S'*S) time: 0.00 resid: 1.96e-19 -LU amd(A'*A) time: 0.00 resid: 1.96e-19 -Chol natural time: 0.00 resid: 2.03e-19 -Chol amd(A+A') time: 0.00 resid: 2.01e-19 +QR natural time: 0.00 resid: 3.65e-19 +QR amd(A'*A) time: 0.00 resid: 4.02e-19 +LU natural time: 0.00 resid: 2.17e-19 +LU amd(A+A') time: 0.00 resid: 1.87e-19 +LU amd(S'*S) time: 0.00 resid: 2.38e-19 +LU amd(A'*A) time: 0.00 resid: 2.38e-19 +Chol natural time: 0.00 resid: 2.64e-19 +Chol amd(A+A') time: 0.00 resid: 2.55e-19 ./build/cs_dl_demo3 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 @@ -541,100 +547,106 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 2.01e-19 +original: resid: 2.55e-19 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 3.21e-18 -rechol: time: 0.00 (incl solve) resid: 3.07e-18 +update: time: 0.00 (incl solve) resid: 9.66e-19 +rechol: time: 0.00 (incl solve) resid: 1.55e-18 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 4.46e-17 +downdate: time: 0.00 (incl solve) resid: 3.74e-17 ./build/cs_dl_demo2 < Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.39 resid: 1.79e-22 -LU amd(A+A') time: 0.18 resid: 1.07e-22 -LU amd(S'*S) time: 0.18 resid: 1.25e-22 -LU amd(A'*A) time: 0.18 resid: 1.91e-22 -Chol amd(A+A') time: 0.05 resid: 1.15e-22 +QR amd(A'*A) time: 0.63 resid: 2.01e-22 +LU amd(A+A') time: 0.32 resid: 1.10e-22 +LU amd(S'*S) time: 0.33 resid: 1.28e-22 +LU amd(A'*A) time: 0.34 resid: 1.78e-22 +Chol amd(A+A') time: 0.12 resid: 1.19e-22 ./build/cs_dl_demo3 < Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 chol then update/downdate amd(A+A') -symbolic chol time 0.00 -numeric chol time 0.05 +symbolic chol time 0.01 +numeric chol time 0.10 solve chol time 0.00 -original: resid: 1.15e-22 +original: resid: 1.19e-22 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 1.31e-23 -rechol: time: 0.05 (incl solve) resid: 1.44e-23 +update: time: 0.00 (incl solve) resid: 1.12e-23 +rechol: time: 0.10 (incl solve) resid: 1.17e-23 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 1.25e-21 -( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) --- Building CXSparse version: v4.3.0 (Dec 30, 2023) --- Source: /Users/davis/dev2/SuiteSparse/CXSparse --- Build: /Users/davis/dev2/SuiteSparse/CXSparse/build --- Install lib: lib --- Install include: include --- Install bin: bin --- Install pkg-file: lib --- Install rpath: --- Build rpath: /Users/davis/dev2/SuiteSparse/CXSparse/build --- Build type: Release --- Fortran: /opt/homebrew/bin/gfortran --- CUDA: not enabled +downdate: time: 0.00 (incl solve) resid: 4.09e-22 +( cd build && cmake -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j8 ) +-- Building CXSparse version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled -- complex data type: enabled --- SuiteSparse_config version: 7.4.0 --- SuiteSparse_config include: /Users/davis/dev2/SuiteSparse/SuiteSparse_config --- SuiteSparse_config library: /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.7.4.0.dylib --- SuiteSparse_config static: /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- SuiteSparse_config version: 7.5.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.5.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a -- Also compiling the demos in CXSparse/Demo -- ------------------------------------------------------------------------ --- SuiteSparse CMAKE report for: cxsparse +-- SuiteSparse CMAKE report for: CXSparse -- ------------------------------------------------------------------------ --- inside common SuiteSparse root: false --- install in SuiteSparse/lib and SuiteSparse/include: OFF +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 -- build type: Release -- BUILD_SHARED_LIBS: ON -- BUILD_STATIC_LIBS: ON --- use OpenMP: no --- C compiler: /Library/Developer/CommandLineTools/usr/bin/cc +-- C compiler: /usr/bin/cc -- C flags: -- C++ compiler: -- C++ flags: -- C Flags release: -O3 -DNDEBUG -- C++ Flags release: --- Fortran compiler: /opt/homebrew/bin/gfortran +-- Fortran compiler: /usr/bin/f95 -- compile definitions: +-- CUDA architectures: 52;75;80 -- ------------------------------------------------------------------------ --- Configuring done (0.0s) +-- Configuring done (0.7s) -- Generating done (0.1s) --- Build files have been written to: /Users/davis/dev2/SuiteSparse/CXSparse/build -[ 89%] Built target CXSparse +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' +[ 78%] Built target CXSparse [ 89%] Built target CXSparse_static -[ 89%] Built target cs_di_demo1 [ 90%] Built target cs_demo3 -[ 91%] Built target cs_di_demo2 -[ 91%] Built target cs_demo1 -[ 92%] Built target cs_dl_demo2 -[ 93%] Built target cs_di_demo3 -[ 94%] Built target cs_demo2 -[ 94%] Built target cs_dl_demo1 -[ 95%] Built target cs_dl_demo3 +[ 91%] Built target cs_demo2 +[ 92%] Built target cs_di_demo2 +[ 92%] Built target cs_dl_demo1 +[ 93%] Built target cs_dl_demo2 +[ 94%] Built target cs_di_demo3 +[ 94%] Built target cs_demo1 +[ 94%] Built target cs_di_demo1 +[ 95%] Built target cs_ci_demo1 +[ 95%] Built target cs_ci_demo2 +[ 95%] Built target cs_cl_demo2 +[ 96%] Built target cs_dl_demo3 +[ 96%] Built target cs_idemo [ 97%] Built target cs_cl_demo1 -[ 97%] Built target cs_ci_demo1 -[ 97%] Built target cs_ci_demo2 -[ 98%] Built target cs_ci_demo3 -[ 97%] Built target cs_idemo -[ 99%] Built target cs_cl_demo3 -[ 99%] Built target cs_cl_demo2 +[ 98%] Built target cs_cl_demo3 +[ 99%] Built target cs_ci_demo3 [100%] Built target cs_ldemo +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' ./build/cs_idemo < Matrix/t2 --- cs_idemo, size of CS_INT: 4 T: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -648,7 +660,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : (1.7, 1) Treal: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -662,7 +674,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : 1.7 Timag: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3.14159 1 0 : 42 @@ -676,7 +688,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : 1 A: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -694,7 +706,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : (0.9, 99) C1 = real(A): -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -712,7 +724,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : 0.9 C2 = imag(A): -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 col 0 : locations 0 to 2 1 : 42 @@ -730,7 +742,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : 99 A1: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : (3.1, 0) @@ -748,7 +760,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : (0.9, 0) A2: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 col 0 : locations 0 to 2 1 : (0, 42) @@ -766,7 +778,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : (0, 99) B = conj(A): -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, -42) @@ -787,7 +799,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 --- cs_ldemo, size of CS_INT: 8 T: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -801,7 +813,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : (1.7, 1) Treal: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -815,7 +827,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : 1.7 Timag: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3.14159 1 0 : 42 @@ -829,7 +841,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : 1 A: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -847,7 +859,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : (0.9, 99) C1 = real(A): -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -865,7 +877,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : 0.9 C2 = imag(A): -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 col 0 : locations 0 to 2 1 : 42 @@ -883,7 +895,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : 99 A1: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : (3.1, 0) @@ -901,7 +913,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : (0.9, 0) A2: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 col 0 : locations 0 to 2 1 : (0, 42) @@ -919,7 +931,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : (0, 99) B = conj(A): -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, -42) @@ -936,9 +948,9 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 3 : (1, -7) 1 : (0.9, -99) ./build/cs_ci_demo1 < Matrix/t2 -CXSparse v4.3.0 +CXSparse v4.3.1 T: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -951,7 +963,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : (4.5, 6) 2 1 : (1.7, 1) A: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -968,7 +980,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 3 : (1, 7) 1 : (0.9, 99) AT: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 144.296 col 0 : locations 0 to 1 0 : (4.5, -6) @@ -985,7 +997,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : (0.4, -2.71828) 3 : (1, -7) D: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 16 nnz: 16, 1-norm: 25308.3 col 0 : locations 0 to 3 1 : (265.95, 170.4) @@ -1011,24 +1023,24 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 --- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.06e+02 blocks: 1 singletons: 0 structural rank: 4 -QR natural time: 0.00 resid: 2.02e-17 -QR amd(A'*A) time: 0.00 resid: 7.71e-18 -LU natural time: 0.00 resid: 4.43e-18 -LU amd(A+A') time: 0.00 resid: 6.17e-18 -LU amd(S'*S) time: 0.00 resid: 8.98e-18 -LU amd(A'*A) time: 0.00 resid: 6.17e-18 +QR natural time: 0.00 resid: 2.06e-17 +QR amd(A'*A) time: 0.00 resid: 6.36e-18 +LU natural time: 0.00 resid: 4.88e-18 +LU amd(A+A') time: 0.00 resid: 2.11e-18 +LU amd(S'*S) time: 0.00 resid: 6.36e-18 +LU amd(A'*A) time: 0.00 resid: 2.11e-18 ./build/cs_ci_demo2 < Matrix/t3 --- Matrix: 3-by-4, nnz: 12 (sym: 0: nnz 0), norm: 3.06e+00 blocks: 1 singletons: 0 structural rank: 3 -QR natural time: 0.00 resid: 6.29e-17 -QR amd(A'*A) time: 0.00 resid: 6.29e-17 +QR natural time: 0.00 resid: 1.05e-16 +QR amd(A'*A) time: 0.00 resid: 1.05e-16 ./build/cs_ci_demo2 < Matrix/t4 --- Matrix: 2-by-2, nnz: 3 (sym: 1: nnz 4), norm: 2.83e+00 blocks: 1 singletons: 0 structural rank: 2 -QR natural time: 0.00 resid: 1.11e-16 -QR amd(A'*A) time: 0.00 resid: 1.11e-16 +QR natural time: 0.00 resid: 5.65e-17 +QR amd(A'*A) time: 0.00 resid: 5.65e-17 LU natural time: 0.00 resid: 0.00e+00 LU amd(A+A') time: 0.00 resid: 0.00e+00 LU amd(S'*S) time: 0.00 resid: 0.00e+00 @@ -1039,58 +1051,58 @@ Chol amd(A+A') time: 0.00 (failed) --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.17e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 5.78e-17 -QR amd(A'*A) time: 0.00 resid: 4.76e-17 -LU natural time: 0.00 resid: 1.07e-16 -LU amd(A+A') time: 0.00 resid: 9.01e-17 -LU amd(S'*S) time: 0.00 resid: 4.37e-17 -LU amd(A'*A) time: 0.00 resid: 5.81e-17 +QR natural time: 0.00 resid: 8.16e-17 +QR amd(A'*A) time: 0.00 resid: 5.34e-17 +LU natural time: 0.00 resid: 4.54e-17 +LU amd(A+A') time: 0.00 resid: 5.90e-17 +LU amd(S'*S) time: 0.00 resid: 5.28e-17 +LU amd(A'*A) time: 0.00 resid: 4.76e-17 ./build/cs_ci_demo2 < Matrix/c_mbeacxc --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.04 resid: nan -QR amd(A'*A) time: 0.05 resid: nan +QR natural time: 0.14 resid: nan +QR amd(A'*A) time: 0.14 resid: nan ./build/cs_ci_demo2 < Matrix/young1c --- Matrix: 841-by-841, nnz: 4089 (sym: 0: nnz 0), norm: 7.30e+02 blocks: 1 singletons: 0 structural rank: 841 -QR natural time: 0.00 resid: 1.53e-16 -QR amd(A'*A) time: 0.00 resid: 1.39e-16 -LU natural time: 0.00 resid: 1.16e-16 -LU amd(A+A') time: 0.00 resid: 3.20e-16 -LU amd(S'*S) time: 0.00 resid: 2.34e-16 -LU amd(A'*A) time: 0.00 resid: 2.34e-16 +QR natural time: 0.01 resid: 1.81e-16 +QR amd(A'*A) time: 0.01 resid: 1.57e-16 +LU natural time: 0.00 resid: 1.39e-16 +LU amd(A+A') time: 0.01 resid: 2.95e-16 +LU amd(S'*S) time: 0.00 resid: 3.37e-16 +LU amd(A'*A) time: 0.00 resid: 3.37e-16 ./build/cs_ci_demo2 < Matrix/qc324 --- Matrix: 324-by-324, nnz: 26730 (sym: 0: nnz 0), norm: 1.71e+00 blocks: 1 singletons: 0 structural rank: 324 -QR natural time: 0.01 resid: 8.03e-17 -QR amd(A'*A) time: 0.01 resid: 8.22e-17 -LU natural time: 0.00 resid: 4.86e-17 -LU amd(A+A') time: 0.00 resid: 3.83e-17 -LU amd(S'*S) time: 0.01 resid: 4.86e-17 -LU amd(A'*A) time: 0.01 resid: 4.86e-17 +QR natural time: 0.02 resid: 9.42e-17 +QR amd(A'*A) time: 0.03 resid: 8.94e-17 +LU natural time: 0.01 resid: 6.01e-17 +LU amd(A+A') time: 0.01 resid: 4.05e-17 +LU amd(S'*S) time: 0.01 resid: 4.71e-17 +LU amd(A'*A) time: 0.01 resid: 4.71e-17 ./build/cs_ci_demo2 < Matrix/neumann --- Matrix: 1600-by-1600, nnz: 7840 (sym: 0: nnz 0), norm: 1.41e+01 blocks: 1 singletons: 0 structural rank: 1600 -QR amd(A'*A) time: 0.01 resid: 1.07e-15 -LU amd(A+A') time: 0.00 resid: 4.59e-16 -LU amd(S'*S) time: 0.00 resid: 4.56e-16 -LU amd(A'*A) time: 0.00 resid: 4.56e-16 +QR amd(A'*A) time: 0.02 resid: 1.04e-15 +LU amd(A+A') time: 0.01 resid: 3.55e-16 +LU amd(S'*S) time: 0.01 resid: 4.03e-16 +LU amd(A'*A) time: 0.01 resid: 4.03e-16 ./build/cs_ci_demo2 < Matrix/c4 --- Matrix: 4-by-4, nnz: 10 (sym: -1: nnz 16), norm: 7.37e+01 blocks: 1 singletons: 0 structural rank: 4 QR natural time: 0.00 resid: 5.85e-17 QR amd(A'*A) time: 0.00 resid: 5.85e-17 -LU natural time: 0.00 resid: 6.88e-17 -LU amd(A+A') time: 0.00 resid: 6.88e-17 -LU amd(S'*S) time: 0.00 resid: 6.88e-17 -LU amd(A'*A) time: 0.00 resid: 6.88e-17 -Chol natural time: 0.00 resid: 9.17e-17 -Chol amd(A+A') time: 0.00 resid: 9.17e-17 +LU natural time: 0.00 resid: 2.29e-17 +LU amd(A+A') time: 0.00 resid: 2.29e-17 +LU amd(S'*S) time: 0.00 resid: 2.29e-17 +LU amd(A'*A) time: 0.00 resid: 2.29e-17 +Chol natural time: 0.00 resid: 6.88e-17 +Chol amd(A+A') time: 0.00 resid: 6.88e-17 ./build/cs_ci_demo3 < Matrix/c4 --- Matrix: 4-by-4, nnz: 10 (sym: -1: nnz 16), norm: 7.37e+01 @@ -1099,21 +1111,21 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 9.17e-17 +original: resid: 6.88e-17 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 7.03e-17 -rechol: time: 0.00 (incl solve) resid: 4.83e-17 +update: time: 0.00 (incl solve) resid: 6.49e-17 +rechol: time: 0.00 (incl solve) resid: 6.49e-17 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 9.17e-17 +downdate: time: 0.00 (incl solve) resid: 5.85e-17 ./build/cs_ci_demo2 < Matrix/mhd1280b --- Matrix: 1280-by-1280, nnz: 11963 (sym: -1: nnz 22646), norm: 8.00e+01 tiny entries dropped: 66 blocks: 20 singletons: 14 structural rank: 1280 -QR amd(A'*A) time: 0.00 resid: 5.96e-25 +QR amd(A'*A) time: 0.00 resid: 6.15e-25 LU amd(A+A') time: 0.00 resid: 2.33e-25 -LU amd(S'*S) time: 0.00 resid: 2.45e-25 -LU amd(A'*A) time: 0.00 resid: 2.45e-25 +LU amd(S'*S) time: 0.00 resid: 3.96e-25 +LU amd(A'*A) time: 0.00 resid: 3.96e-25 Chol amd(A+A') time: 0.00 resid: 1.58e-25 ./build/cs_ci_demo3 < Matrix/mhd1280b @@ -1123,16 +1135,16 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 2.14e-25 +original: resid: 1.51e-25 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 2.14e-25 -rechol: time: 0.00 (incl solve) resid: 2.14e-25 +update: time: 0.00 (incl solve) resid: 1.75e-25 +rechol: time: 0.00 (incl solve) resid: 1.71e-25 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 6.66e-25 +downdate: time: 0.00 (incl solve) resid: 5.85e-25 ./build/cs_cl_demo1 < Matrix/t2 -CXSparse v4.3.0 +CXSparse v4.3.1 T: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -1145,7 +1157,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : (4.5, 6) 2 1 : (1.7, 1) A: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -1162,7 +1174,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 3 : (1, 7) 1 : (0.9, 99) AT: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 10 nnz: 10, 1-norm: 144.296 col 0 : locations 0 to 1 0 : (4.5, -6) @@ -1179,7 +1191,7 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : (0.4, -2.71828) 3 : (1, -7) D: -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 4-by-4, nzmax: 16 nnz: 16, 1-norm: 25308.3 col 0 : locations 0 to 3 1 : (265.95, 170.4) @@ -1205,24 +1217,24 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 --- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.06e+02 blocks: 1 singletons: 0 structural rank: 4 -QR natural time: 0.00 resid: 2.02e-17 -QR amd(A'*A) time: 0.00 resid: 7.71e-18 -LU natural time: 0.00 resid: 4.43e-18 -LU amd(A+A') time: 0.00 resid: 6.17e-18 -LU amd(S'*S) time: 0.00 resid: 8.98e-18 -LU amd(A'*A) time: 0.00 resid: 6.17e-18 +QR natural time: 0.00 resid: 2.06e-17 +QR amd(A'*A) time: 0.00 resid: 6.36e-18 +LU natural time: 0.00 resid: 4.88e-18 +LU amd(A+A') time: 0.00 resid: 2.11e-18 +LU amd(S'*S) time: 0.00 resid: 6.36e-18 +LU amd(A'*A) time: 0.00 resid: 2.11e-18 ./build/cs_cl_demo2 < Matrix/t3 --- Matrix: 3-by-4, nnz: 12 (sym: 0: nnz 0), norm: 3.06e+00 blocks: 1 singletons: 0 structural rank: 3 -QR natural time: 0.00 resid: 6.29e-17 -QR amd(A'*A) time: 0.00 resid: 6.29e-17 +QR natural time: 0.00 resid: 1.05e-16 +QR amd(A'*A) time: 0.00 resid: 1.05e-16 ./build/cs_cl_demo2 < Matrix/t4 --- Matrix: 2-by-2, nnz: 3 (sym: 1: nnz 4), norm: 2.83e+00 blocks: 1 singletons: 0 structural rank: 2 -QR natural time: 0.00 resid: 1.11e-16 -QR amd(A'*A) time: 0.00 resid: 1.11e-16 +QR natural time: 0.00 resid: 5.65e-17 +QR amd(A'*A) time: 0.00 resid: 5.65e-17 LU natural time: 0.00 resid: 0.00e+00 LU amd(A+A') time: 0.00 resid: 0.00e+00 LU amd(S'*S) time: 0.00 resid: 0.00e+00 @@ -1233,58 +1245,58 @@ Chol amd(A+A') time: 0.00 (failed) --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.17e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 5.78e-17 -QR amd(A'*A) time: 0.00 resid: 4.76e-17 -LU natural time: 0.00 resid: 1.07e-16 -LU amd(A+A') time: 0.00 resid: 9.01e-17 -LU amd(S'*S) time: 0.00 resid: 4.37e-17 -LU amd(A'*A) time: 0.00 resid: 5.81e-17 +QR natural time: 0.00 resid: 8.16e-17 +QR amd(A'*A) time: 0.00 resid: 5.34e-17 +LU natural time: 0.00 resid: 4.54e-17 +LU amd(A+A') time: 0.00 resid: 5.90e-17 +LU amd(S'*S) time: 0.00 resid: 5.28e-17 +LU amd(A'*A) time: 0.00 resid: 4.76e-17 ./build/cs_cl_demo2 < Matrix/c_mbeacxc --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.04 resid: nan -QR amd(A'*A) time: 0.05 resid: nan +QR natural time: 0.14 resid: nan +QR amd(A'*A) time: 0.14 resid: nan ./build/cs_cl_demo2 < Matrix/young1c --- Matrix: 841-by-841, nnz: 4089 (sym: 0: nnz 0), norm: 7.30e+02 blocks: 1 singletons: 0 structural rank: 841 -QR natural time: 0.00 resid: 1.53e-16 -QR amd(A'*A) time: 0.00 resid: 1.39e-16 -LU natural time: 0.00 resid: 1.16e-16 -LU amd(A+A') time: 0.00 resid: 3.20e-16 -LU amd(S'*S) time: 0.00 resid: 2.34e-16 -LU amd(A'*A) time: 0.00 resid: 2.34e-16 +QR natural time: 0.01 resid: 1.81e-16 +QR amd(A'*A) time: 0.01 resid: 1.57e-16 +LU natural time: 0.00 resid: 1.39e-16 +LU amd(A+A') time: 0.01 resid: 2.95e-16 +LU amd(S'*S) time: 0.00 resid: 3.37e-16 +LU amd(A'*A) time: 0.00 resid: 3.37e-16 ./build/cs_cl_demo2 < Matrix/qc324 --- Matrix: 324-by-324, nnz: 26730 (sym: 0: nnz 0), norm: 1.71e+00 blocks: 1 singletons: 0 structural rank: 324 -QR natural time: 0.01 resid: 8.03e-17 -QR amd(A'*A) time: 0.01 resid: 8.22e-17 -LU natural time: 0.00 resid: 4.86e-17 -LU amd(A+A') time: 0.00 resid: 3.83e-17 -LU amd(S'*S) time: 0.01 resid: 4.86e-17 -LU amd(A'*A) time: 0.01 resid: 4.86e-17 +QR natural time: 0.02 resid: 9.42e-17 +QR amd(A'*A) time: 0.02 resid: 8.94e-17 +LU natural time: 0.01 resid: 6.01e-17 +LU amd(A+A') time: 0.01 resid: 4.05e-17 +LU amd(S'*S) time: 0.01 resid: 4.71e-17 +LU amd(A'*A) time: 0.01 resid: 4.71e-17 ./build/cs_cl_demo2 < Matrix/neumann --- Matrix: 1600-by-1600, nnz: 7840 (sym: 0: nnz 0), norm: 1.41e+01 blocks: 1 singletons: 0 structural rank: 1600 -QR amd(A'*A) time: 0.01 resid: 1.07e-15 -LU amd(A+A') time: 0.00 resid: 4.59e-16 -LU amd(S'*S) time: 0.00 resid: 4.56e-16 -LU amd(A'*A) time: 0.00 resid: 4.56e-16 +QR amd(A'*A) time: 0.01 resid: 1.04e-15 +LU amd(A+A') time: 0.01 resid: 3.55e-16 +LU amd(S'*S) time: 0.01 resid: 4.03e-16 +LU amd(A'*A) time: 0.01 resid: 4.03e-16 ./build/cs_cl_demo2 < Matrix/c4 --- Matrix: 4-by-4, nnz: 10 (sym: -1: nnz 16), norm: 7.37e+01 blocks: 1 singletons: 0 structural rank: 4 QR natural time: 0.00 resid: 5.85e-17 QR amd(A'*A) time: 0.00 resid: 5.85e-17 -LU natural time: 0.00 resid: 6.88e-17 -LU amd(A+A') time: 0.00 resid: 6.88e-17 -LU amd(S'*S) time: 0.00 resid: 6.88e-17 -LU amd(A'*A) time: 0.00 resid: 6.88e-17 -Chol natural time: 0.00 resid: 9.17e-17 -Chol amd(A+A') time: 0.00 resid: 9.17e-17 +LU natural time: 0.00 resid: 2.29e-17 +LU amd(A+A') time: 0.00 resid: 2.29e-17 +LU amd(S'*S) time: 0.00 resid: 2.29e-17 +LU amd(A'*A) time: 0.00 resid: 2.29e-17 +Chol natural time: 0.00 resid: 6.88e-17 +Chol amd(A+A') time: 0.00 resid: 6.88e-17 ./build/cs_cl_demo3 < Matrix/c4 --- Matrix: 4-by-4, nnz: 10 (sym: -1: nnz 16), norm: 7.37e+01 @@ -1293,21 +1305,21 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 9.17e-17 +original: resid: 6.88e-17 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 7.03e-17 -rechol: time: 0.00 (incl solve) resid: 4.83e-17 +update: time: 0.00 (incl solve) resid: 6.49e-17 +rechol: time: 0.00 (incl solve) resid: 6.49e-17 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 9.17e-17 +downdate: time: 0.00 (incl solve) resid: 5.85e-17 ./build/cs_cl_demo2 < Matrix/mhd1280b --- Matrix: 1280-by-1280, nnz: 11963 (sym: -1: nnz 22646), norm: 8.00e+01 tiny entries dropped: 66 blocks: 20 singletons: 14 structural rank: 1280 -QR amd(A'*A) time: 0.00 resid: 5.96e-25 +QR amd(A'*A) time: 0.00 resid: 6.15e-25 LU amd(A+A') time: 0.00 resid: 2.33e-25 -LU amd(S'*S) time: 0.00 resid: 2.45e-25 -LU amd(A'*A) time: 0.00 resid: 2.45e-25 +LU amd(S'*S) time: 0.00 resid: 3.96e-25 +LU amd(A'*A) time: 0.00 resid: 3.96e-25 Chol amd(A+A') time: 0.00 resid: 1.58e-25 ./build/cs_cl_demo3 < Matrix/mhd1280b @@ -1317,9 +1329,9 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 2.14e-25 +original: resid: 1.51e-25 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 2.14e-25 -rechol: time: 0.00 (incl solve) resid: 2.14e-25 +update: time: 0.00 (incl solve) resid: 1.75e-25 +rechol: time: 0.00 (incl solve) resid: 1.71e-25 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 6.66e-25 +downdate: time: 0.00 (incl solve) resid: 5.85e-25 diff --git a/CXSparse/Include/cs.h b/CXSparse/Include/cs.h index b27b34aaf6..bf80e35da0 100644 --- a/CXSparse/Include/cs.h +++ b/CXSparse/Include/cs.h @@ -2,7 +2,7 @@ // CXSparse/Include/cs.h: include file for CXSparse //------------------------------------------------------------------------------ -// CXSparse, Copyright (c) 2006-2023, Timothy A. Davis, All Rights Reserved +// CXSparse, Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved // SPDX-License-Identifier: LGPL-2.1+ //------------------------------------------------------------------------------ @@ -37,16 +37,17 @@ #define CS_VER 4 /* CXSparse Version */ #define CS_SUBVER 3 -#define CS_SUBSUB 0 -#define CS_DATE "Dec 30, 2023" /* CXSparse release date */ -#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2023" +#define CS_SUBSUB 1 +#define CS_DATE "Jan 10, 2024" /* CXSparse release date */ +#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2024" #define CXSPARSE #include "SuiteSparse_config.h" -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "CXSparse 4.3.0 requires SuiteSparse_config 7.4 or later" +#define CXSPARSE__VERSION SUITESPARSE__VERCODE(4,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "CXSparse 4.3.1 requires SuiteSparse_config 7.5.0 or later" #endif #define cs_long_t int64_t diff --git a/ChangeLog b/ChangeLog index f68fa9fa62..96319ede1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,38 @@ +Jan 10, 2024: version 7.5.0 + + * Suitesparse_config: 7.5.0, to reflect the addition of GraphBLAS 9.0.0. + Minor updates to build system, including bug fixes when specifying a + specific BLAS/LAPACK library, and configuration of *.pc files. + * GraphBLAS 9.0.0: supporting the v2.1 C API; + see https://github.com/GraphBLAS/graphblas-api-c + * Example 1.6.0: using GraphBLAS 9.0.0 and SuiteSparse_config 7.5.0, + remove explicit dependencies on OpenMP, libm, GMP, and MPFR. + Add programs to test the *Config.cmake of each package. + * All other packages (except CSparse): minor updates to build system + and MATLAB interfaces + + * Package versions in this release: + SuiteSparse_config 7.5.0 + AMD 3.3.1 + BTF 2.3.1 + CAMD 3.3.1 + CCOLAMD 3.3.1 + CHOLMOD 5.1.1 + COLAMD 3.3.1 + CSparse 4.3.0 (unchanged from SuiteSparse 7.4.0) + CXSparse 4.3.1 + Example 1.6.0 + GraphBLAS 9.0.0 + KLU 2.3.1 + LDL 3.3.1 + LAGraph 1.1.1 + SuiteSparse_Mongoose 3.3.1 + ParU 0.1.1 + RBio 4.3.1 + SPEX 2.3.1 + SPQR 4.3.1 + UMFPACK 6.3.1 + Dec 30, 2023: version 7.4.0 * major change to build system: by Markus Mützel. Includes a diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index a3b6e70c27..344e17320f 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -53,9 +53,9 @@ message ( STATUS "MY prefix path: ${CMAKE_PREFIX_PATH}" ) #------------------------------------------------------------------------------- # cmake inserts the date and version number into Include/my.h: -set ( MY_DATE "Dec 30, 2023" ) +set ( MY_DATE "Jan 10, 2024" ) set ( MY_VERSION_MAJOR 1 ) -set ( MY_VERSION_MINOR 5 ) +set ( MY_VERSION_MINOR 6 ) set ( MY_VERSION_PATCH 0 ) message ( STATUS "Building MY library version: v" @@ -87,33 +87,25 @@ project ( my #------------------------------------------------------------------------------- # look for all SuiteSparse packages: -find_package ( SuiteSparse_config 7.4.0 REQUIRED ) -find_package ( AMD 3.3.0 REQUIRED ) -find_package ( BTF 2.3.0 REQUIRED ) -find_package ( CAMD 3.3.0 REQUIRED ) -find_package ( CCOLAMD 3.3.0 REQUIRED ) -find_package ( CHOLMOD 5.1.0 REQUIRED ) -find_package ( COLAMD 3.3.0 REQUIRED ) -find_package ( CXSparse 4.3.0 REQUIRED ) -find_package ( GraphBLAS 8.3.1 ) -find_package ( KLU 2.3.0 REQUIRED ) -find_package ( KLU_CHOLMOD 2.3.0 REQUIRED ) -find_package ( LDL 3.3.0 REQUIRED ) -find_package ( LAGraph 1.1.0 ) -find_package ( SuiteSparse_Mongoose 3.3.0 REQUIRED ) -find_package ( ParU 0.1.0 REQUIRED ) -find_package ( RBio 4.3.0 REQUIRED ) -find_package ( SPEX 2.3.0 REQUIRED ) # requires GMP and MPFR -find_package ( SPQR 4.3.0 REQUIRED ) -find_package ( UMFPACK 6.3.0 REQUIRED ) - -# look for all external libaries: -find_package ( OpenMP REQUIRED ) -find_package ( BLAS REQUIRED ) -find_package ( LAPACK REQUIRED ) -# the SPEX/Find*.cmake packages are installed when SPEX is installed. -find_package ( GMP 6.1.2 REQUIRED ) -find_package ( MPFR 4.0.2 REQUIRED ) +find_package ( SuiteSparse_config 7.5.0 REQUIRED ) +find_package ( AMD 3.3.1 REQUIRED ) +find_package ( BTF 2.3.1 REQUIRED ) +find_package ( CAMD 3.3.1 REQUIRED ) +find_package ( CCOLAMD 3.3.1 REQUIRED ) +find_package ( CHOLMOD 5.1.1 REQUIRED ) +find_package ( COLAMD 3.3.1 REQUIRED ) +find_package ( CXSparse 4.3.1 REQUIRED ) +find_package ( GraphBLAS 9.0.0 ) +find_package ( KLU 2.3.1 REQUIRED ) +find_package ( KLU_CHOLMOD 2.3.1 REQUIRED ) +find_package ( LDL 3.3.1 REQUIRED ) +find_package ( LAGraph 1.1.1 ) +find_package ( SuiteSparse_Mongoose 3.3.1 REQUIRED ) +find_package ( ParU 0.1.1 REQUIRED ) +find_package ( RBio 4.3.1 REQUIRED ) +find_package ( SPEX 2.3.1 REQUIRED ) # requires GMP and MPFR +find_package ( SPQR 4.3.1 REQUIRED ) +find_package ( UMFPACK 6.3.1 REQUIRED ) #------------------------------------------------------------------------------- # configure files @@ -510,82 +502,100 @@ if ( BUILD_STATIC_LIBS ) endif ( ) endif ( ) -# OpenMP: -message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES}" ) -message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS}" ) -message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS}" ) -if ( BUILD_SHARED_LIBS ) - target_link_libraries ( my PRIVATE OpenMP::OpenMP_C ) - target_link_libraries ( my_cxx PRIVATE OpenMP::OpenMP_CXX ) -endif ( ) -if ( BUILD_STATIC_LIBS ) - target_link_libraries ( my_static PUBLIC OpenMP::OpenMP_C ) - target_link_libraries ( my_cxx_static PUBLIC OpenMP::OpenMP_CXX ) -endif ( ) +#------------------------------------------------------------------------------- +# other libraries +#------------------------------------------------------------------------------- -# libm: -if ( NOT WIN32 ) +# The "MY" library does not directly rely on the OpenMP, libm, BLAS, LAPACK, +# GMP, and MPFR libraries. However, if you wish to create a library that +# uses those libraries, uncomment the corresponding section. For example, +# when using SPEX, it would be common to also need direct access to GMP and +# MPFR. These direct dependencies are left out of the MY CMakeLists.txt, as +# a test for the other SuiteSparse cmake build system, to ensure that the +# libraries should be linked via the libraries that depend on them. For +# example, linking with SPEX (above) should bring in GMP and MPRF for use in +# SPEX (but not in MY). + +if ( 0 ) + + # OpenMP: + message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES}" ) + message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS}" ) + message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS}" ) if ( BUILD_SHARED_LIBS ) - target_link_libraries ( my PRIVATE m ) - target_link_libraries ( my_cxx PRIVATE m ) + target_link_libraries ( my PRIVATE OpenMP::OpenMP_C ) + target_link_libraries ( my_cxx PRIVATE OpenMP::OpenMP_CXX ) endif ( ) if ( BUILD_STATIC_LIBS ) - target_link_libraries ( my_static PUBLIC m ) - target_link_libraries ( my_cxx_static PUBLIC m ) + target_link_libraries ( my_static PUBLIC OpenMP::OpenMP_C ) + target_link_libraries ( my_cxx_static PUBLIC OpenMP::OpenMP_CXX ) endif ( ) -endif ( ) -# BLAS: -message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" ) -message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS}" ) -message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS}" ) -if ( BUILD_SHARED_LIBS ) - target_link_libraries ( my PRIVATE ${BLAS_LIBRARIES} ) - target_link_libraries ( my_cxx PRIVATE ${BLAS_LIBRARIES} ) -endif ( ) -if ( BUILD_STATIC_LIBS ) - target_link_libraries ( my_static PUBLIC ${BLAS_LIBRARIES} ) - target_link_libraries ( my_cxx_static PUBLIC ${BLAS_LIBRARIES} ) -endif ( ) -include_directories ( ${BLAS_INCLUDE_DIRS} ) + # libm: + if ( NOT WIN32 ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( my PRIVATE m ) + target_link_libraries ( my_cxx PRIVATE m ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_link_libraries ( my_static PUBLIC m ) + target_link_libraries ( my_cxx_static PUBLIC m ) + endif ( ) + endif ( ) -# LAPACK: -message ( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" ) -message ( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIRS}" ) -message ( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS}" ) -if ( BUILD_SHARED_LIBS ) - target_link_libraries ( my PRIVATE ${LAPACK_LIBRARIES} ) - target_link_libraries ( my_cxx PRIVATE ${LAPACK_LIBRARIES} ) -endif ( ) -if ( BUILD_STATIC_LIBS ) - target_link_libraries ( my_static PUBLIC ${LAPACK_LIBRARIES} ) - target_link_libraries ( my_cxx_static PUBLIC ${LAPACK_LIBRARIES} ) -endif ( ) -include_directories ( ${LAPACK_INCLUDE_DIRS} ) + # BLAS: + message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" ) + message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS}" ) + message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS}" ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( my PRIVATE ${BLAS_LIBRARIES} ) + target_link_libraries ( my_cxx PRIVATE ${BLAS_LIBRARIES} ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_link_libraries ( my_static PUBLIC ${BLAS_LIBRARIES} ) + target_link_libraries ( my_cxx_static PUBLIC ${BLAS_LIBRARIES} ) + endif ( ) + include_directories ( ${BLAS_INCLUDE_DIRS} ) -# gmp: -message ( STATUS "GMP library: ${GMP_LIBRARIES}" ) -if ( BUILD_SHARED_LIBS ) - target_link_libraries ( my PRIVATE ${GMP_LIBRARIES} ) - target_link_libraries ( my_cxx PRIVATE ${GMP_LIBRARIES} ) -endif ( ) -if ( BUILD_STATIC_LIBS ) - target_link_libraries ( my_static PUBLIC ${GMP_STATIC} ) - target_link_libraries ( my_cxx_static PUBLIC ${GMP_STATIC} ) -endif ( ) -include_directories ( ${GMP_INCLUDE_DIR} ) + # LAPACK: + message ( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" ) + message ( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIRS}" ) + message ( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS}" ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( my PRIVATE ${LAPACK_LIBRARIES} ) + target_link_libraries ( my_cxx PRIVATE ${LAPACK_LIBRARIES} ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_link_libraries ( my_static PUBLIC ${LAPACK_LIBRARIES} ) + target_link_libraries ( my_cxx_static PUBLIC ${LAPACK_LIBRARIES} ) + endif ( ) + include_directories ( ${LAPACK_INCLUDE_DIRS} ) + + # gmp: + message ( STATUS "GMP library: ${GMP_LIBRARIES}" ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( my PRIVATE ${GMP_LIBRARIES} ) + target_link_libraries ( my_cxx PRIVATE ${GMP_LIBRARIES} ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_link_libraries ( my_static PUBLIC ${GMP_STATIC} ) + target_link_libraries ( my_cxx_static PUBLIC ${GMP_STATIC} ) + endif ( ) + include_directories ( ${GMP_INCLUDE_DIR} ) + + # mpfr: + message ( STATUS "MPFR library: ${MPFR_LIBRARIES}" ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( my PRIVATE ${MPFR_LIBRARIES} ) + target_link_libraries ( my_cxx PRIVATE ${MPFR_LIBRARIES} ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_link_libraries ( my_static PUBLIC ${MPFR_STATIC} ) + target_link_libraries ( my_cxx_static PUBLIC ${MPFR_STATIC} ) + endif ( ) + include_directories ( ${MPFR_INCLUDE_DIR} ) -# mpfr: -message ( STATUS "MPFR library: ${MPFR_LIBRARIES}" ) -if ( BUILD_SHARED_LIBS ) - target_link_libraries ( my PRIVATE ${MPFR_LIBRARIES} ) - target_link_libraries ( my_cxx PRIVATE ${MPFR_LIBRARIES} ) -endif ( ) -if ( BUILD_STATIC_LIBS ) - target_link_libraries ( my_static PUBLIC ${MPFR_STATIC} ) - target_link_libraries ( my_cxx_static PUBLIC ${MPFR_STATIC} ) endif ( ) -include_directories ( ${MPFR_INCLUDE_DIR} ) #------------------------------------------------------------------------------- # installation location @@ -620,7 +630,7 @@ if ( BUILD_SHARED_LIBS ) add_executable ( my_demo "Demo/my_demo.c" ) target_link_libraries ( my_demo PUBLIC my ) - add_executable ( my_cxx_demo "Demo/my_demo.c" ) + add_executable ( my_cxx_demo "Demo/my_demo.cc" ) target_link_libraries ( my_cxx_demo PUBLIC my_cxx ) endif ( ) @@ -628,7 +638,7 @@ if ( BUILD_STATIC_LIBS ) add_executable ( my_demo_static "Demo/my_demo.c" ) target_link_libraries ( my_demo_static PUBLIC my_static ) - add_executable ( my_cxx_demo_static "Demo/my_demo.c" ) + add_executable ( my_cxx_demo_static "Demo/my_demo.cc" ) target_link_libraries ( my_cxx_demo_static PUBLIC my_cxx_static ) endif ( ) diff --git a/Example/Demo/my_demo.cc b/Example/Demo/my_demo.cc new file mode 100644 index 0000000000..127a95de70 --- /dev/null +++ b/Example/Demo/my_demo.cc @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/Example/Demo/my_demo.c +//------------------------------------------------------------------------------ + +// Copyright (c) 2022-2023, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// Example user program + +#include + +#include "my.h" + +int main (void) +{ + std::cout << "My demo" << std::endl ; + int version [3] ; + char date [128] ; + my_version (version, date) ; + std::cout << "Date from #include 'my.h': " << MY_DATE << std::endl ; + std::cout << "Date from compiled library: " << date << std::endl ; + std::cout << "version from #include 'my.h.': " << + MY_MAJOR_VERSION << '.' << MY_MINOR_VERSION << '.' << MY_PATCH_VERSION << std::endl ; + std::cout << "version from compiled library: " << + version [0] << '.' << version [1] << '.' << version [2] << std::endl ; + + int result = my_function ( ) ; + return (result) ; +} + diff --git a/Example/Demo/mydemo.out b/Example/Demo/mydemo.out index 61d1a60e15..86eed904d1 100644 --- a/Example/Demo/mydemo.out +++ b/Example/Demo/mydemo.out @@ -1,22 +1,142 @@ +( cd build && cmake .. && cmake --build . --config Release -j8 ) +-- MY prefix path: /home/faculty/d/davis/dev2/SuiteSparse/Example/.. +-- Building MY library version: v1.6.0 (Jan 10, 2024) +-- Found OpenMP: TRUE (found version "4.5") found components: C +-- SuiteSparse_config version: 7.5.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libsuitesparseconfig.so.7.5.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libsuitesparseconfig.a +-- AMD version: 3.3.1 +-- AMD include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- AMD library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libamd.so.3.3.1 +-- AMD static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libamd.a +-- BTF version: 2.3.1 +-- BTF include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- BTF library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libbtf.so.2.3.1 +-- BTF static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libbtf.a +-- CAMD version: 3.3.1 +-- CAMD include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- CAMD library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcamd.so.3.3.1 +-- CAMD static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcamd.a +-- CCOLAMD version: 3.3.1 +-- CCOLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- CCOLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libccolamd.so.3.3.1 +-- CCOLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libccolamd.a +-- COLAMD version: 3.3.1 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcolamd.so.3.3.1 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcolamd.a +-- CHOLMOD version: 5.1.1 +-- CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcholmod.so.5.1.1 +-- CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcholmod.a +-- COLAMD version: 3.3.1 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcolamd.so.3.3.1 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcolamd.a +-- CXSparse version: 4.3.1 +-- CXSparse include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- CXSparse library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcxsparse.so.4.3.1 +-- CXSparse static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libcxsparse.a +-- GraphBLAS version: 9.0.0 +-- GraphBLAS include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- GraphBLAS library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libgraphblas.so.9.0.0 +-- GraphBLAS static: +-- KLU version: 2.3.1 +-- KLU include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- KLU library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libklu.so.2.3.1 +-- KLU static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libklu.a +-- KLU_CHOLMOD version: 2.3.1 +-- KLU_CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- KLU_CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libklu_cholmod.so.2.3.1 +-- KLU_CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libklu_cholmod.a +-- LDL version: 3.3.1 +-- LDL include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- LDL library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libldl.so.3.3.1 +-- LDL static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libldl.a +-- GraphBLAS version: 9.0.0 +-- GraphBLAS include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- GraphBLAS library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libgraphblas.so.9.0.0 +-- GraphBLAS static: +-- LAGraph version: 1.1.1 +-- LAGraph include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- LAGraph library: /home/faculty/d/davis/dev2/SuiteSparse/lib/liblagraph.so.1.1.1 +-- LAGraph static: /home/faculty/d/davis/dev2/SuiteSparse/lib/liblagraph.a +-- SuiteSparse_Mongoose version: 3.3.1 +-- SuiteSparse_Mongoose include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- SuiteSparse_Mongoose library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libsuitesparse_mongoose.so.3 +-- SuiteSparse_Mongoose static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libsuitesparse_mongoose.a +-- UMFPACK version: 6.3.1 +-- UMFPACK include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- UMFPACK library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libumfpack.so.6.3.1 +-- UMFPACK static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libumfpack.a +-- Found OpenMP: TRUE (found version "4.5") found components: CXX +-- ParU version: 0.1.1 +-- ParU include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- ParU library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libparu.so.0.1.1 +-- ParU static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libparu.a +-- RBio version: 4.3.1 +-- RBio include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- RBio library: /home/faculty/d/davis/dev2/SuiteSparse/lib/librbio.so.4.3.1 +-- RBio static: /home/faculty/d/davis/dev2/SuiteSparse/lib/librbio.a +-- SPEX version: 2.3.1 +-- SPEX include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- SPEX library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libspex.so.2.3.1 +-- SPEX static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libspex.a +-- SuiteSparse_GPURuntime version: 4.3.1 +-- SuiteSparse_GPURuntime include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- SuiteSparse_GPURuntime library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libsuitesparse_gpuruntime.so.4.3.1 +-- SuiteSparse_GPURuntime static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libsuitesparse_gpuruntime.a +-- GPUQREngine version: 4.3.1 +-- GPUQREngine include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- GPUQREngine library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libgpuqrengine.so.4.3.1 +-- GPUQREngine static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libgpuqrengine.a +-- SPQR version: 4.3.1 +-- SPQR include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- SPQR library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libspqr.so.4.3.1 +-- SPQR static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libspqr.a +-- UMFPACK version: 6.3.1 +-- UMFPACK include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- UMFPACK library: /home/faculty/d/davis/dev2/SuiteSparse/lib/libumfpack.so.6.3.1 +-- UMFPACK static: /home/faculty/d/davis/dev2/SuiteSparse/lib/libumfpack.a +-- MY source: /home/faculty/d/davis/dev2/SuiteSparse/Example +-- MY build: /home/faculty/d/davis/dev2/SuiteSparse/Example/build +-- MY install prefix: /usr/local +-- MY install rpath: +-- MY build rpath: +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/Example/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/Example/build' +[ 12%] Built target my +[ 25%] Built target my_static +[ 37%] Built target my_cxx +[ 50%] Built target my_cxx_static +[ 62%] Built target my_demo +[ 75%] Built target my_demo_static +[ 87%] Built target my_cxx_demo_static +[100%] Built target my_cxx_demo +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/Example/build' +( cd build && ./my_demo ) My demo -Date from #include 'my.h': Dec 30, 2023 -Date from compiled library: Dec 30, 2023 -version from #include 'my.h.': 1.5.0 -version from compiled library: 1.5.0 +Date from #include 'my.h': Jan 10, 2024 +Date from compiled library: Jan 10, 2024 +version from #include 'my.h.': 1.6.0 +version from compiled library: 1.6.0 ------------------------------------------------------------ -MY: v1.5.0 (Dec 30, 2023) -MY: v1.5.0 (in library) -MY date: Dec 30, 2023 +MY: v1.6.0 (Jan 10, 2024) +MY: v1.6.0 (in library) +MY date: Jan 10, 2024 ------------------------------------------------------------ -SuiteSparse_config: v7.4.0 (Dec 30, 2023) -SuiteSparse_config: v7.4.0 (in library) +SuiteSparse_config: v7.5.0 (Jan 10, 2024) +SuiteSparse_config: v7.5.0 (in library) ------------------------------------------------------------ -CXSparse: v4.3.0 (Dec 30, 2023) -CXSparse: v4.3.0 (in library) -CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +CXSparse: v4.3.1 (Jan 10, 2024) +CXSparse: v4.3.1 (in library) +CXSparse Version 4.3.1, Jan 10, 2024. Copyright (c) Timothy A. Davis, 2006-2024 2-by-2, nzmax: 4 nnz: 4, 1-norm: 34 col 0 : locations 0 to 1 0 : 11 @@ -26,14 +146,14 @@ CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 1 : 22 ------------------------------------------------------------ -AMD: v3.3.0 (Dec 30, 2023) -AMD: v3.3.0 (in library) +AMD: v3.3.1 (Jan 10, 2024) +AMD: v3.3.1 (in library) P [0] = 0 P [1] = 1 ------------------------------------------------------------ -BTF: v2.3.0 (Dec 30, 2023) -BTF: v2.3.0 (in library) +BTF: v2.3.1 (Jan 10, 2024) +BTF: v2.3.1 (in library) P [0] = 0 P [1] = 1 Q [0] = 0 @@ -41,52 +161,52 @@ Q [1] = 1 nblocks 1 ------------------------------------------------------------ -CAMD: v3.3.0 (Dec 30, 2023) -CAMD: v3.3.0 (in library) +CAMD: v3.3.1 (Jan 10, 2024) +CAMD: v3.3.1 (in library) P [0] = 0 P [1] = 1 ------------------------------------------------------------ -CCOLAMD: v3.3.0 (Dec 30, 2023) -CCOLAMD: v3.3.0 (in library) +CCOLAMD: v3.3.1 (Jan 10, 2024) +CCOLAMD: v3.3.1 (in library) P [0] = 0 P [1] = 1 ------------------------------------------------------------ -COLAMD: v3.3.0 (Dec 30, 2023) -COLAMD: v3.3.0 (in library) +COLAMD: v3.3.1 (Jan 10, 2024) +COLAMD: v3.3.1 (in library) P [0] = 0 P [1] = 1 ------------------------------------------------------------ -CHOLMOD: v5.1.0 (Dec 30, 2023) -CHOLMOD: v5.1.0 (in library) +CHOLMOD: v5.1.1 (Jan 10, 2024) +CHOLMOD: v5.1.1 (in library) ------------------------------------------------------------ -GraphBLAS: v8.3.1 (Dec 30, 2023) -GraphBLAS: v8.3.1 (in library) +GraphBLAS: v9.0.0 (Jan 10, 2024) +GraphBLAS: v9.0.0 (in library) ------------------------------------------------------------ -LAGraph: v1.1.0 (Dec 30, 2023) -LAGraph: v1.1.0 (in library) +LAGraph: v1.1.1 (Jan 10, 2024) +LAGraph: v1.1.1 (in library) ------------------------------------------------------------ -KLU: v2.3.0 (Dec 30, 2023) -KLU: v2.3.0 (in library) +KLU: v2.3.1 (Jan 10, 2024) +KLU: v2.3.1 (in library) x [0] = 36.4 x [1] = -32.7 error: 7.10543e-14 ------------------------------------------------------------ -LDL: v3.3.0 (Dec 30, 2023) -LDL: v3.3.0 (in library) +LDL: v3.3.1 (Jan 10, 2024) +LDL: v3.3.1 (in library) x2 [0] = 36.4 x2 [1] = -32.7 error: 0 ------------------------------------------------------------ -RBio: v4.3.0 (Dec 30, 2023) -RBio: v4.3.0 (in library) +RBio: v4.3.1 (Jan 10, 2024) +RBio: v4.3.1 (in library) njumbled 0, nzeros 0 result 0 mtype: iua @@ -99,12 +219,12 @@ iua 2 2 4 0 11 21 12 22 ------------------------------------------------------------ -SPEX: v2.3.0 (Dec 30, 2023) -SPEX: v2.3.0 (in library) +SPEX: v2.3.1 (Jan 10, 2024) +SPEX: v2.3.1 (in library) ------------------------------------------------------------ -SuiteSparseQR: v4.3.0 (Dec 30, 2023) -SuiteSparseQR: v4.3.0 (in library) +SuiteSparseQR: v4.3.1 (Jan 10, 2024) +SuiteSparseQR: v4.3.1 (in library) CHOLMOD dense: X from QR: 2-by-1, leading dimension 2, nzmax 2, real, double @@ -115,10 +235,10 @@ CHOLMOD dense: X from QR: 2-by-1, ------------------------------------------------------------ -UMFPACK: v6.3.0 (Dec 30, 2023) -UMFPACK: v6.3.0 (in library) -UMFPACK V6.3.0 (Dec 30, 2023) -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: v6.3.1 (Jan 10, 2024) +UMFPACK: v6.3.1 (in library) +UMFPACK V6.3.1 (Jan 10, 2024) +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. UMFPACK License: SPDX-License-Identifier: GPL-2.0+ UMFPACK is available under alternate licenses, @@ -129,7 +249,7 @@ x [0] = 36.4 x [1] = -32.7 error: 5.68434e-14 -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. UMFPACK License: SPDX-License-Identifier: GPL-2.0+ @@ -138,14 +258,14 @@ UMFPACK License: SPDX-License-Identifier: GPL-2.0+ Availability: http://www.suitesparse.com -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 2 number of columns in matrix A: 2 entries in matrix A: 4 diff --git a/Example/Include/my.h b/Example/Include/my.h index 393e2b0b5f..4336ee712e 100644 --- a/Example/Include/my.h +++ b/Example/Include/my.h @@ -11,9 +11,9 @@ // file, since it is constructed from Config/my.h.in by cmake. // version and date for example user library -#define MY_DATE "Dec 30, 2023" +#define MY_DATE "Jan 10, 2024" #define MY_MAJOR_VERSION 1 -#define MY_MINOR_VERSION 5 +#define MY_MINOR_VERSION 6 #define MY_PATCH_VERSION 0 #ifdef __cplusplus diff --git a/Example/Include/my_internal.h b/Example/Include/my_internal.h index 7f5a0f9187..deb99fbfc9 100644 --- a/Example/Include/my_internal.h +++ b/Example/Include/my_internal.h @@ -12,96 +12,90 @@ #ifndef MY_INTERNAL_H #define MY_INTERNAL_H -#undef VER3CODE -#define VER3CODE(major,minor,sub) (((major)*1000ULL + (minor))*1000ULL + (sub)) - // SuiteSparse include files for C/C++: #include "SuiteSparse_config.h" -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "This library requires SuiteSparse_config 7.4.0 or later" +#if !defined (SUITESPARSE__VERSION) || SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0) +#error "This library requires SuiteSparse_config 7.5.0 or later" #endif #include "amd.h" -#if AMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "This library requires AMD 3.3.0 or later" +#if !defined (AMD__VERSION) || AMD__VERSION < SUITESPARSE__VERCODE(3,3,1) +#error "This library requires AMD 3.3.1 or later" #endif #include "btf.h" -#if AMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "This library requires BTF 3.3.0 or later" +#if !defined (BTF__VERSION) || BTF__VERSION < SUITESPARSE__VERCODE(2,3,1) +#error "This library requires BTF 2.3.0 or later" #endif #include "camd.h" -#if CAMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "This library requires CAMD 3.3.0 or later" +#if !defined (CAMD__VERSION) || CAMD__VERSION < SUITESPARSE__VERCODE(3,3,1) +#error "This library requires CAMD 3.3.1 or later" #endif #include "ccolamd.h" -#if CCOLAMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "This library requires CCOLAMD 3.3.0 or later" +#if !defined (CCOLAMD__VERSION) || CCOLAMD__VERSION < SUITESPARSE__VERCODE(3,3,1) +#error "This library requires CCOLAMD 3.3.1 or later" #endif #include "cholmod.h" -#if CHOLMOD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "This library requires CHOLMOD 5.1.0 or later" +#if !defined (CHOLMOD__VERSION) || CHOLMOD__VERSION < SUITESPARSE__VERCODE(5,1,1) +#error "This library requires CHOLMOD 5.1.1 or later" #endif #include "colamd.h" -#if COLAMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "This library requires COLAMD 3.3.0 or later" +#if !defined (COLAMD__VERSION) || COLAMD__VERSION < SUITESPARSE__VERCODE(3,3,1) +#error "This library requires COLAMD 3.3.1 or later" #endif #include "cs.h" -// #if ! defined (CXSPARSE) || (CS_VERSION < SUITESPARSE_VER_CODE(3,3)) -// #error "This library requires CXSparse 3.3.0 or later" -// #endif +#if !defined (CXSPARSE__VERSION) || CXSPARSE__VERSION < SUITESPARSE__VERCODE(4,3,1) +#error "This library requires CXSparse 4.3.1 or later" +#endif #if ! defined (NO_GRAPHBLAS) #include "GraphBLAS.h" #if !defined ( GxB_SUITESPARSE_GRAPHBLAS ) || \ - GxB_IMPLEMENTATION < GxB_VERSION (8,3,1) - #error "This library requires SuiteSparse:GraphBLAS 8.3.1 or later" + GxB_IMPLEMENTATION < GxB_VERSION (9,0,0) + #error "This library requires SuiteSparse:GraphBLAS 9.0.0 or later" #endif #endif #if ! defined (NO_LAGRAPH) #include "LAGraph.h" - #if VER3CODE (LAGRAPH_VERSION_MAJOR,LAGRAPH_VERSION_MINOR, \ - LAGRAPH_VERSION_UPDATE) < VER3CODE(1,1,0) - #error "This library requires LAGraph 1.1.0 or later" + #if SUITESPARSE__VERCODE(LAGRAPH_VERSION_MAJOR,LAGRAPH_VERSION_MINOR,LAGRAPH_VERSION_UPDATE) < SUITESPARSE__VERCODE(1,1,1) + #error "This library requires LAGraph 1.1.1 or later" #endif #endif #include "klu.h" -#if KLU_VERSION < SUITESPARSE_VER_CODE(2,3) -#error "This library requires KLU 2.3.0 or later" +#if !defined (KLU__VERSION) || KLU__VERSION < SUITESPARSE__VERCODE(2,3,1) +#error "This library requires KLU 2.3.1 or later" #endif #include "ldl.h" -#if LDL_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "This library requires LDL 3.3.0 or later" +#if !defined (LDL__VERSION) || LDL__VERSION < SUITESPARSE__VERCODE(3,3,1) +#error "This library requires LDL 3.3.1 or later" #endif #include "RBio.h" -#if RBIO_VERSION < SUITESPARSE_VER_CODE(4,3) -#error "This library requires RBio 4.3.0 or later" +#if !defined (RBIO__VERSION) || RBIO__VERSION < SUITESPARSE__VERCODE(4,3,1) +#error "This library requires RBio 4.3.1 or later" #endif #include "SPEX.h" -#if VER3CODE (SPEX_VERSION_MAJOR,SPEX_VERSION_MINOR, SPEX_VERSION_SUB) \ - < VER3CODE(2,3,0) -#error "This library requires SPEX 2.3.0 or later" +#if !defined (SPEX__VERSION) || SPEX__VERSION < SUITESPARSE__VERCODE(2,3,1) +#error "This library requires SPEX 2.3.1 or later" #endif #include "SuiteSparseQR_C.h" -#if SPQR_VERSION < SUITESPARSE_VER_CODE(4,3) -#error "This library requires SPQR 4.3.0 or later" +#if !defined (SPQR__VERSION) || SPQR__VERSION < SUITESPARSE__VERCODE(4,3,1) +#error "This library requires SPQR 4.3.1 or later" #endif #include "umfpack.h" -#if UMFPACK_VER < SUITESPARSE_VER_CODE(4,3) -#error "This library requires UMFPACK 6.3.0 or later" +#if !defined (UMFPACK__VERSION) || UMFPACK__VERSION < SUITESPARSE__VERCODE(6,3,1) +#error "This library requires UMFPACK 6.3.1 or later" #endif // SuiteSparse include files for C++: @@ -109,9 +103,8 @@ #include "SuiteSparseQR.hpp" #include "Mongoose.hpp" - #if VER3CODE (Mongoose_VERSION_MAJOR,Mongoose_VERSION_MINOR, \ - Mongoose_VERSION_PATCH) < VER3CODE(3,3,0) - #error "This library requires Mongoose 3.3.0 or later" + #if !defined (Mongoose__VERSION) || Mongoose__VERSION < SUITESPARSE__VERCODE(3,3,1) + #error "This library requires Mongoose 3.3.1 or later" #endif #endif diff --git a/Example/Makefile b/Example/Makefile index ae23787c63..00d5e24444 100644 --- a/Example/Makefile +++ b/Example/Makefile @@ -61,7 +61,7 @@ uninstall: # remove all files not in the distribution clean: - - $(RM) -rf build/* Config/*.tmp + - $(RM) -rf build/* Config/*.tmp temp.rb purge: clean diff --git a/Example/Makefile.am b/Example/Makefile.am new file mode 100644 index 0000000000..2484bde191 --- /dev/null +++ b/Example/Makefile.am @@ -0,0 +1,69 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2023, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +# A simple Makefile for the MY library in SuiteSparse/Example, which relies on +# libtool. + +# To compile with an alternate compiler: +# +# make CC=gcc CXX=g++ +# +# To clean up the files: +# +# make clean + +noinst_LTLIBRARIES = \ + %reldir%/libmy.la \ + %reldir%/libmy_cxx.la + +%canon_reldir%_libmy_la_SOURCES = %reldir%/Source/my.c +%canon_reldir%_libmy_la_CPPFLAGS = -I../Include @SUITESPARSE_CFLAGS@ +%canon_reldir%_libmy_la_LIBADD = @SUITESPARSE_LIBS@ + +%canon_reldir%_libmy_cxx_la_SOURCES = %reldir%/Source/my_cxx.cc +%canon_reldir%_libmy_cxx_la_CPPFLAGS = -I../Include @SUITESPARSE_CFLAGS@ +%canon_reldir%_libmy_cxx_la_LIBADD = @SUITESPARSE_LIBS@ + +if AMCOND_HAVE_GRAPHBLAS +%canon_reldir%_libmy_la_CPPFLAGS += @GRAPHBLAS_CFLAGS@ +%canon_reldir%_libmy_la_LIBADD += @GRAPHBLAS_LIBS@ + +%canon_reldir%_libmy_cxx_la_CPPFLAGS += @GRAPHBLAS_CFLAGS@ +%canon_reldir%_libmy_cxx_la_LIBADD += @GRAPHBLAS_LIBS@ +else +%canon_reldir%_libmy_la_CPPFLAGS += -DNO_GRAPHBLAS + +%canon_reldir%_libmy_cxx_la_CPPFLAGS += -DNO_GRAPHBLAS +endif + +if AMCOND_HAVE_LAGRAPH +%canon_reldir%_libmy_la_CPPFLAGS += @LAGRAPH_CFLAGS@ +%canon_reldir%_libmy_la_LIBADD += @LAGRAPH_LIBS@ + +%canon_reldir%_libmy_cxx_la_CPPFLAGS += @LAGRAPH_CFLAGS@ +%canon_reldir%_libmy_cxx_la_LIBADD += @LAGRAPH_LIBS@ +else +%canon_reldir%_libmy_la_CPPFLAGS += -DNO_LAGRAPH + +%canon_reldir%_libmy_cxx_la_CPPFLAGS += -DNO_LAGRAPH +endif + +demo_PROGRAMS = \ + %reldir%/my_demo \ + %reldir%/my_cxx_demo + +demodir = %canon_reldir% + +%canon_reldir%_my_demo_SOURCES = %reldir%/Demo/my_demo.c +%canon_reldir%_my_demo_CPPFLAGS = -I../Include +%canon_reldir%_my_demo_LDADD = %reldir%/libmy.la + +%canon_reldir%_my_cxx_demo_SOURCES = %reldir%/Demo/my_demo.cc +%canon_reldir%_my_cxx_demo_CPPFLAGS = -I../Include +%canon_reldir%_my_cxx_demo_LDADD = %reldir%/libmy_cxx.la diff --git a/Example/README.md b/Example/README.md index 3d52388341..2899a0dbf2 100644 --- a/Example/README.md +++ b/Example/README.md @@ -1,6 +1,6 @@ SuiteSparse/Example: create a package that relies on SuiteSparse -Copyright (c) 2022-2023, Timothy A. Davis, All Rights Reserved. +Copyright (c) 2022-2024, Timothy A. Davis, All Rights Reserved. SPDX-License-Identifier: BSD-3-clause An example of how to use the SuiteSparse `Find*.cmake` files in cmake @@ -13,7 +13,8 @@ to build a library that depends on SuiteSparse libraries. Include/my.h created by cmake from Config/my.h.in Include/my_internal.h internal include file Config/my.h.in input file for Include/my.h - Demo/my_demo.c demo program that uses 'my' package + Demo/my_demo.c C demo program that uses 'my' package + Demo/my_demo.cc C++ demo program that uses 'my' package Demo/mydemo.out output of my_demo Source/my.c library source code (C) Source/my_cxx.cc library source code (C++) @@ -21,16 +22,18 @@ to build a library that depends on SuiteSparse libraries. The 'my' library relies on the following SuiteSparse libraries, each of which has a cmake module to use in `find_package` that is installed alongside the -compiled libraries (/usr/local/lib/cmake/SuiteSparse) `AMD`, `BTF`, `CAMD`, -`CCOLAMD`, `CHOLMOD`, `COLAMD`, `CXSparse`, `GPUQREngine`, `GraphBLAS`, `KLU`, -`KLU_CHOLMOD`, `LAGraph`, `LDL`, `Mongoose`, `RBio`, `SPEX`, `SPQR`, -`SPQR_CUDA`, `SuiteSparse_GPURuntime`, `SuiteSparse_config`, and `UMFPACK`. +compiled libraries: `AMD`, `BTF`, `CAMD`, `CCOLAMD`, `CHOLMOD`, `COLAMD`, +`CXSparse`, `GPUQREngine`, `GraphBLAS`, `KLU`, `KLU_CHOLMOD`, `LAGraph`, `LDL`, +`Mongoose`, `RBio`, `SPEX`, `SPQR`, `SPQR_CUDA`, `SuiteSparse_GPURuntime`, +`SuiteSparse_config`, and `UMFPACK`. In addition, the 'my' package relies on the following external libraries: `BLAS`, `LAPACK`, `OpenMP`, `GMP`, and `MPFR`. To compile the `my` package and run a demo program: + First, compile and install all SuiteSparse packages. Next: + On Linux or Mac: make diff --git a/Example/configure.ac b/Example/configure.ac new file mode 100644 index 0000000000..70766e2416 --- /dev/null +++ b/Example/configure.ac @@ -0,0 +1,41 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CC +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse libraries +PKG_CHECK_MODULES([SUITESPARSE], [SuiteSparse_config AMD BTF CAMD CCOLAMD CHOLMOD COLAMD CXSparse KLU KLU_CHOLMOD LDL SuiteSparse_Mongoose ParU RBio SPEX SPQR UMFPACK]) + +PKG_CHECK_MODULES([GRAPHBLAS], [GraphBLAS], [use_graphblas=yes], [use_graphblas=no]) +AM_CONDITIONAL([AMCOND_HAVE_GRAPHBLAS], [test $use_graphblas = yes]) + +PKG_CHECK_MODULES([LAGRAPH], [LAGraph], [use_lagraph=yes], [use_lagraph=no]) +AM_CONDITIONAL([AMCOND_HAVE_LAGRAPH], [test $use_lagraph = yes]) + +# Check if linker flags are needed for function fmax. +# Adds -lm to LIBS if needed. +AC_CHECK_FUNC(fmax, [], AC_CHECK_LIB(m, fmax)) + +# Check for C++ STL. +# If found, this will add -lstdc++ to LIBS. +# FIXME: This is a workaround to allow linking CUDA libraries to a C binary. +AC_CHECK_LIB(stdc++, __gxx_personality_v0) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index ab72d746b8..8d91ff83a8 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -105,7 +105,11 @@ if ( NOT SUITESPARSE_USE_OPENMP ) set ( GRAPHBLAS_USE_OPENMP "OFF" CACHE STRING "" FORCE ) endif ( ) if ( GRAPHBLAS_USE_OPENMP ) - find_package ( OpenMP GLOBAL ) + if ( CMAKE_VERSION VERSION_LESS 3.24 ) + find_package ( OpenMP COMPONENTS C ) + else ( ) + find_package ( OpenMP COMPONENTS C GLOBAL ) + endif ( ) else ( ) # OpenMP has been disabled. set ( OpenMP_C_FOUND OFF ) @@ -363,11 +367,11 @@ endif ( ) # cpu_features settings #------------------------------------------------------------------------------- +include ( CheckSymbolExists ) if ( NOT GBNCPUFEAT ) if ( UNIX ) # look for requirements for cpu_features/src/hwcaps.c include ( CheckIncludeFile ) - include ( CheckSymbolExists ) check_include_file ( dlfcn.h HAVE_DLFCN_H ) if ( HAVE_DLFCN_H ) message ( STATUS "cpu_feautures has dlfcn.h" ) @@ -400,7 +404,8 @@ endif ( ) #------------------------------------------------------------------------------- # libm: -if ( NOT WIN32 ) +check_symbol_exists ( fmax "math.h" NO_LIBM ) +if ( NOT NO_LIBM ) set ( GB_M "m" ) if ( BUILD_SHARED_LIBS ) target_link_libraries ( GraphBLAS PRIVATE m ) @@ -461,9 +466,9 @@ if ( GRAPHBLAS_HAS_OPENMP ) endif ( ) message ( STATUS "CMAKE OpenMP C flags: ${OpenMP_C_FLAGS}" ) else ( ) - message ( WARNING + message ( WARNING "WARNING: OpenMP was not found (or was disabled with " - "GRAPHBLAS_USE_OPENMP). See the GrapBLAS user guide on the consequences " + "GRAPHBLAS_USE_OPENMP). See the GraphBLAS user guide on the consequences " "of compiling GraphBLAS without OpenMP. GraphBLAS will work but may not be " "thread-safe, since it relies on '#pragma omp flush' to ensure the work " "performed by one user thread is available to another, in GrB_wait. If " @@ -476,7 +481,7 @@ else ( ) include ( SuiteSparse__thread ) if ( NOT HAVE_KEYWORD__DECLSPEC_THREAD AND NOT HAVE_KEYWORD__THREAD AND NOT HAVE_KEYWORD__THREAD_LOCAL ) - message ( WARNING + message ( WARNING "The C compiler does not support thread-local-storage; " "GxB_Context_engage will return GrB_NOT_IMPLEMENTED." ) endif ( ) diff --git a/GraphBLAS/CUDA/CMakeLists.txt b/GraphBLAS/CUDA/CMakeLists.txt index 198053a0c5..2b477a36bf 100644 --- a/GraphBLAS/CUDA/CMakeLists.txt +++ b/GraphBLAS/CUDA/CMakeLists.txt @@ -74,6 +74,10 @@ set_target_properties ( GraphBLAS_CUDA PROPERTIES CUDA_ARCHITECTURES "52;75;80" target_link_libraries ( GraphBLAS_CUDA PRIVATE CUDA::nvrtc CUDA::cudart_static CUDA::cuda_driver ) +if ( TARGET CUDA::nvToolsExt ) + target_link_libraries ( GraphBLAS_CUDA PRIVATE CUDA::nvToolsExt ) +endif ( ) + if ( TARGET CUDA::nvtx3 ) target_link_libraries ( GraphBLAS_CUDA PRIVATE CUDA::nvtx3 ) target_compile_definitions ( GraphBLAS_CUDA PRIVATE GBNVTX ) diff --git a/GraphBLAS/CUDA/Config/GB_cuda_common_jitFactory.hpp.in b/GraphBLAS/CUDA/Config/GB_cuda_common_jitFactory.hpp.in index a4576e7583..5d7ad01e6f 100644 --- a/GraphBLAS/CUDA/Config/GB_cuda_common_jitFactory.hpp.in +++ b/GraphBLAS/CUDA/Config/GB_cuda_common_jitFactory.hpp.in @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_cuda_common_jitFactory.hpp: common defines for all jitFactory classes +// GraphBLAS/CUDA/GB_cuda_common_jitFactory.hpp: for all jitFactory classes //------------------------------------------------------------------------------ -// (c) Nvidia Corp. 2020 All rights reserved +// (c) Nvidia Corp. 2023 All rights reserved // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,26 +16,24 @@ // configured by cmake from the following file: // GraphBLAS/CUDA/Config/GB_cuda_common_jitFactory.hpp.in -#ifndef GB_COMMON_JITFACTORY_H -#define GB_COMMON_JITFACTORY_H +#ifndef GB_CUDA_COMMON_JITFACTORY_HPP +#define GB_CUDA_COMMON_JITFACTORY_HPP #pragma once +#include "GraphBLAS_cuda.h" + extern "C" { #include "GB.h" - #include "GraphBLAS.h" - #undef I #include "GB_stringify.h" } #include #include -#include "GB_jit_cache.h" -#include "GB_jit_launcher.h" +#include "GB_cuda_jitify_cache.h" +#include "GB_cuda_jitify_launcher.h" #include "GB_cuda_mxm_factory.hpp" -#include "GB_cuda_buckets.h" -#include "GB_cuda_type_wrap.hpp" #include "GB_cuda_error.h" #include "../rmm_wrap/rmm_wrap.h" #include "GB_iceil.h" @@ -43,27 +41,38 @@ extern "C" // amount of shared memory to use in CUDA kernel launches constexpr unsigned int SMEM = 0 ; -static const std::vector GB_jit_cuda_compiler_flags{ +#if 0 + +static const std::vector GB_jit_cuda_compiler_flags{ // OLD "-std=c++17", //"-G", "-remove-unused-globals", "-w", "-D__CUDACC_RTC__", -// "-I.", -// "-I..", -// "-I../templates", -// "-I../CUDA", -// "-I../Source/Shared", - - // Add includes relative to GRAPHBLAS_SOURCE_PATH variable - "-I" + jit::get_user_graphblas_source_path() + "/CUDA", - "-I" + jit::get_user_graphblas_source_path() + "/Source/Shared", - "-I" + jit::get_user_graphblas_source_path() + "/CUDA/templates", +// "-I" + jit::get_user_home_cache_dir(), // FIXME: add +/cu/00 +// "-I" + jit::get_user_home_cache_dir() + "/src", "-I/usr/local/cuda/include", - // FIXME: add SUITESPARSE_CUDA_ARCHITECTURES here, via config }; +#endif + +inline std::vector GB_cuda_jit_compiler_flags ( ) +{ + return ( + std::vector ( + {"-std=c++17", + //"-G", + "-remove-unused-globals", + "-w", + "-D__CUDACC_RTC__", + "-I" + jit::get_user_home_cache_dir(), // FIXME: add +/cu/00 + "-I" + jit::get_user_home_cache_dir() + "/src", + "-I/usr/local/cuda/include" + // FIXME: add SUITESPARSE_CUDA_ARCHITECTURES here, via config + })) ; +} ; + // FIXME: rename GB_jit_cuda_header_names or something static const std::vector header_names ={}; diff --git a/GraphBLAS/CUDA/GB_cuda.h b/GraphBLAS/CUDA/GB_cuda.h index df57f0003c..3dac3a7c5e 100644 --- a/GraphBLAS/CUDA/GB_cuda.h +++ b/GraphBLAS/CUDA/GB_cuda.h @@ -1,14 +1,12 @@ //------------------------------------------------------------------------------ -// GB_cuda.h: definitions for using CUDA in GraphBLAS +// GraphBLAS/CUDA/GB_cuda.h //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS/CUDA, (c) NVIDIA Corp. 2017-2019, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// This file is #include'd only in the GraphBLAS/CUDA/GB_cuda*.cu source files. - #ifndef GB_CUDA_H #define GB_CUDA_H @@ -20,9 +18,7 @@ extern "C" #include "GB_warnings.h" } -#define GB_LIBRARY -#include "GraphBLAS.h" -#undef I +#include "GraphBLAS_cuda.h" extern "C" { diff --git a/GraphBLAS/CUDA/GB_AxB_dot3_cuda_branch.cpp b/GraphBLAS/CUDA/GB_cuda_AxB_dot3_branch.cpp similarity index 91% rename from GraphBLAS/CUDA/GB_AxB_dot3_cuda_branch.cpp rename to GraphBLAS/CUDA/GB_cuda_AxB_dot3_branch.cpp index bdbbddd6b1..c69dc2132f 100644 --- a/GraphBLAS/CUDA/GB_AxB_dot3_cuda_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_AxB_dot3_branch.cpp @@ -1,16 +1,16 @@ //------------------------------------------------------------------------------ -// GB_AxB_dot3_cuda_branch: decide if GPU should be used for dot3 mxm +// GraphBLAS/CUDA/GB_cuda_AxB_dot3_branch: decide to use GPU for dot3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // Decide branch direction for GPU use for the dot-product MxM -#include "GraphBLAS.h" -#undef I +#include "GraphBLAS_cuda.h" + extern "C" { #include "GB_mxm.h" @@ -18,7 +18,7 @@ extern "C" #include "GB_cuda.h" #include -bool GB_AxB_dot3_cuda_branch +bool GB_cuda_AxB_dot3_branch ( const GrB_Matrix M, // mask matrix const bool Mask_struct, // if true, use the only structure of M diff --git a/GraphBLAS/CUDA/GB_AxB_dot3_cuda.cpp b/GraphBLAS/CUDA/GB_cuda_AxB_dot3_jit.cpp similarity index 97% rename from GraphBLAS/CUDA/GB_AxB_dot3_cuda.cpp rename to GraphBLAS/CUDA/GB_cuda_AxB_dot3_jit.cpp index 7d30afb0a3..5933403dd9 100644 --- a/GraphBLAS/CUDA/GB_AxB_dot3_cuda.cpp +++ b/GraphBLAS/CUDA/GB_cuda_AxB_dot3_jit.cpp @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_AxB_dot3_cuda: compute C = A'*B in parallel, on the GPU(s) +// GraphBLAS/CUDA/GB_cuda_AxB_dot3_jit: compute C = A'*B on GPU(s) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,11 +18,10 @@ extern "C" #include "GB_mxm.h" } -#include "GB_jit_cache.h" +#include "GB_cuda_jitify_cache.h" #include "GB_cuda_common_jitFactory.hpp" #include "GB_cuda_reduce_jitFactory.hpp" #include "GB_cuda_mxm_dot3_jitFactory.hpp" -#include "GB_cuda_type_wrap.hpp" #include "test/GpuTimer.h" /* @@ -60,7 +59,7 @@ void print_array(void *arr, I size, const char *name) { // GB_AxB_dot3_cuda //------------------------------------------------------------------------------ -GrB_Info GB_AxB_dot3_cuda // C = A'*B using dot product method +GrB_Info GB_cuda_AxB_dot3_jit // C = A'*B using dot product method ( GrB_Matrix C, // output matrix const GrB_Matrix M, // mask matrix @@ -291,7 +290,7 @@ GrB_Info GB_AxB_dot3_cuda // C = A'*B using dot product method dense_phase1launchFactory dp1lf(my_mxm_spec); - GBURBLE ("(GPU phase1 start nblk = %d) ", + GBURBLE ("(GPU dense phase1 start nblk = %d) ", dp1lf.get_number_of_blocks(M)) ; kernel_timer.Start(); dp1lf.jitGridBlockLaunch(C, M, A, B, stream); @@ -381,7 +380,8 @@ GrB_Info GB_AxB_dot3_cuda // C = A'*B using dot product method // phase1: assign each C(i,j) to a bucket, and count them //---------------------------------------------------------------------- - GBURBLE ("(GPU phase1 start nblk = %d) ", p1lf.get_number_of_blocks(M)); + GBURBLE ("(GPU sparse phase1 start nblk = %d) ", + p1lf.get_number_of_blocks(M)); kernel_timer.Start(); p1lf.jitGridBlockLaunch(Nanobuckets, Blockbucket, C, M, A, B, stream); CU_OK (cudaStreamSynchronize(stream)); diff --git a/GraphBLAS/CUDA/GB_cuda_common_jitFactory.hpp b/GraphBLAS/CUDA/GB_cuda_common_jitFactory.hpp index a4576e7583..5d7ad01e6f 100644 --- a/GraphBLAS/CUDA/GB_cuda_common_jitFactory.hpp +++ b/GraphBLAS/CUDA/GB_cuda_common_jitFactory.hpp @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_cuda_common_jitFactory.hpp: common defines for all jitFactory classes +// GraphBLAS/CUDA/GB_cuda_common_jitFactory.hpp: for all jitFactory classes //------------------------------------------------------------------------------ -// (c) Nvidia Corp. 2020 All rights reserved +// (c) Nvidia Corp. 2023 All rights reserved // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,26 +16,24 @@ // configured by cmake from the following file: // GraphBLAS/CUDA/Config/GB_cuda_common_jitFactory.hpp.in -#ifndef GB_COMMON_JITFACTORY_H -#define GB_COMMON_JITFACTORY_H +#ifndef GB_CUDA_COMMON_JITFACTORY_HPP +#define GB_CUDA_COMMON_JITFACTORY_HPP #pragma once +#include "GraphBLAS_cuda.h" + extern "C" { #include "GB.h" - #include "GraphBLAS.h" - #undef I #include "GB_stringify.h" } #include #include -#include "GB_jit_cache.h" -#include "GB_jit_launcher.h" +#include "GB_cuda_jitify_cache.h" +#include "GB_cuda_jitify_launcher.h" #include "GB_cuda_mxm_factory.hpp" -#include "GB_cuda_buckets.h" -#include "GB_cuda_type_wrap.hpp" #include "GB_cuda_error.h" #include "../rmm_wrap/rmm_wrap.h" #include "GB_iceil.h" @@ -43,27 +41,38 @@ extern "C" // amount of shared memory to use in CUDA kernel launches constexpr unsigned int SMEM = 0 ; -static const std::vector GB_jit_cuda_compiler_flags{ +#if 0 + +static const std::vector GB_jit_cuda_compiler_flags{ // OLD "-std=c++17", //"-G", "-remove-unused-globals", "-w", "-D__CUDACC_RTC__", -// "-I.", -// "-I..", -// "-I../templates", -// "-I../CUDA", -// "-I../Source/Shared", - - // Add includes relative to GRAPHBLAS_SOURCE_PATH variable - "-I" + jit::get_user_graphblas_source_path() + "/CUDA", - "-I" + jit::get_user_graphblas_source_path() + "/Source/Shared", - "-I" + jit::get_user_graphblas_source_path() + "/CUDA/templates", +// "-I" + jit::get_user_home_cache_dir(), // FIXME: add +/cu/00 +// "-I" + jit::get_user_home_cache_dir() + "/src", "-I/usr/local/cuda/include", - // FIXME: add SUITESPARSE_CUDA_ARCHITECTURES here, via config }; +#endif + +inline std::vector GB_cuda_jit_compiler_flags ( ) +{ + return ( + std::vector ( + {"-std=c++17", + //"-G", + "-remove-unused-globals", + "-w", + "-D__CUDACC_RTC__", + "-I" + jit::get_user_home_cache_dir(), // FIXME: add +/cu/00 + "-I" + jit::get_user_home_cache_dir() + "/src", + "-I/usr/local/cuda/include" + // FIXME: add SUITESPARSE_CUDA_ARCHITECTURES here, via config + })) ; +} ; + // FIXME: rename GB_jit_cuda_header_names or something static const std::vector header_names ={}; diff --git a/GraphBLAS/CUDA/GB_cuda_cumsum.cu b/GraphBLAS/CUDA/GB_cuda_cumsum.cu index c784180c31..da6b32f504 100644 --- a/GraphBLAS/CUDA/GB_cuda_cumsum.cu +++ b/GraphBLAS/CUDA/GB_cuda_cumsum.cu @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_cuda_cumsum: cumlative sum of an array using GPU acceleration +// GraphBLAS/CUDA/GB_cuda_cumsum: cumlative sum of an array on the GPU(s) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_error.h b/GraphBLAS/CUDA/GB_cuda_error.h index 719c519cde..d9aec9b3ff 100644 --- a/GraphBLAS/CUDA/GB_cuda_error.h +++ b/GraphBLAS/CUDA/GB_cuda_error.h @@ -1,5 +1,13 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/GB_cuda_error.h +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + /* - * Copyright (c) 2022 NVIDIA CORPORATION. + * Copyright (c) 2023 NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,4 +79,4 @@ inline void __printLastCudaError(const char *errorMessage, const char *file, } #define CHECK_CUDA(call) checkCudaErrors( call ) -#endif \ No newline at end of file +#endif diff --git a/GraphBLAS/CUDA/GB_cuda_get_device_count.cu b/GraphBLAS/CUDA/GB_cuda_get_device_count.cu index cf7ed54962..7cad833fa1 100644 --- a/GraphBLAS/CUDA/GB_cuda_get_device_count.cu +++ b/GraphBLAS/CUDA/GB_cuda_get_device_count.cu @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ -// GB_cuda_get_device_count.cu: find out how many GPUs exist +// GraphBLAS/CUDA/GB_cuda_get_device_count.cu: find out how many GPUs exist //------------------------------------------------------------------------------ +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. -// http://suitesparse.com See GraphBLAS/Doc/License.txt for license. //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_get_device_properties.cu b/GraphBLAS/CUDA/GB_cuda_get_device_properties.cu index a1fe58a468..7bb7e1407f 100644 --- a/GraphBLAS/CUDA/GB_cuda_get_device_properties.cu +++ b/GraphBLAS/CUDA/GB_cuda_get_device_properties.cu @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ -// GB_cuda_get_device_properties.cu: get the properties of a GPU +// GraphBLAS/CUDA/GB_cuda_get_device_properties: get the properties of a GPU //------------------------------------------------------------------------------ +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. -// http://suitesparse.com See GraphBLAS/Doc/License.txt for license. //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_jit_cache.cu b/GraphBLAS/CUDA/GB_cuda_jitify_cache.cu similarity index 66% rename from GraphBLAS/CUDA/GB_jit_cache.cu rename to GraphBLAS/CUDA/GB_cuda_jitify_cache.cu index 426c202873..3e66d735b5 100644 --- a/GraphBLAS/CUDA/GB_jit_cache.cu +++ b/GraphBLAS/CUDA/GB_cuda_jitify_cache.cu @@ -1,5 +1,13 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/GB_cuda_jitify_cache.cu +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + /* - * Copyright (c) 2019,2020 NVIDIA CORPORATION. + * Copyright (c) 2019,2023 NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +22,8 @@ * limitations under the License. */ +//------------------------------------------------------------------------------ + #include #include #include @@ -23,94 +33,35 @@ #include #include -#include "GB_jit_cache.h" -#include "GraphBLAS.h" -#undef I -// from GraphBLAS.h (for example): -// #define GxB_IMPLEMENTATION_MAJOR 6 -// #define GxB_IMPLEMENTATION_MINOR 0 -// #define GxB_IMPLEMENTATION_SUB 3 +#include "GB_cuda_jitify_cache.h" +#include "GraphBLAS_cuda.h" + +extern "C" +{ + #include "GB.h" + #include "GB_jitifyer.h" +} namespace jit { // Get the directory in home to use for storing the cache std::string get_user_home_cache_dir() { - auto home_dir = std::getenv("HOME"); - if (home_dir != nullptr) { - std::string Major_ver = GB_XSTR (GxB_IMPLEMENTATION_MAJOR) ; - std::string Minor_ver = GB_XSTR (GxB_IMPLEMENTATION_MINOR) ; - std::string Imple_sub = GB_XSTR (GxB_IMPLEMENTATION_SUB) ; - return std::string(home_dir) + "/.SuiteSparse/GrB" - + Major_ver+"."+Minor_ver+"."+Imple_sub; - } else { - return std::string(); + const char *path = GB_jitifyer_get_cache_path ( ) ; + if (path == NULL) + { + return std::string ("") ; + } + else + { + return std::string (path) ; } } -// Get the directory in home to use for storing the cache - std::string get_user_graphblas_source_path() { - auto gb_home = std::getenv("GRAPHBLAS_SOURCE_PATH"); - if (gb_home != nullptr) return std::string(gb_home); - else return std::string(); - } - - -// Default `GRAPHBLAS_CACHE_PATH` to `$HOME/.GraphBLAS`. -// This definition can be overridden at compile time by specifying a -// `-DGRAPHBLAS_CACHE_PATH=/kernel/cache/path` CMake argument. -// This path is used in the `getCacheDir()` function below. -#if !defined(GRAPHBLAS_CACHE_PATH) -#define GRAPHBLAS_CACHE_PATH get_user_home_cache_dir() -#endif - -/** - * @brief Get the string path to the JITIFY kernel cache directory. - * - * This path can be overridden at runtime by defining an environment variable - * named `GRAPHBLAS_CACHE_PATH`. The value of this variable must be a path - * under which the process' user has read/write priveleges. - * - * This function returns a path to the cache directory, creating it if it - * doesn't exist. - * - * The default cache directory is `$HOME/.GraphBLAS`. If no overrides - * are used and if $HOME is not defined, returns an empty path and file - * caching is not used. - **/ -std::string getCacheDir() { - // The environment variable always overrides the - // default/compile-time value of `GRAPHBLAS_CACHE_PATH` - // FIXME: use GB_jitifyer_get_cache_path ( ) here. - //std::cout<<"Cache-dir runtime=>"<< get_user_home_cache_dir() << std::endl; - auto kernel_cache_path_env = std::getenv("GRAPHBLAS_CACHE_PATH"); - //auto kernel_cache_path_env = get_user_home_cache_dir(); - auto kernel_cache_path = (kernel_cache_path_env != nullptr ? kernel_cache_path_env - : GRAPHBLAS_CACHE_PATH); - - struct stat st; - //if ( (stat( kernel_cache_path.c_str(), &st) != 0) ) { - if ( (stat( kernel_cache_path.c_str(), &st) != 0) ) { - // `mkdir -p` the kernel cache path if it doesn't exist -// printf("cache is going to path %s\n", kernel_cache_path.c_str()); - int status; - //status = std::filesystem::create_directories(kernel_cache_path.c_str()); - status = std::filesystem::create_directories(kernel_cache_path); -// if (status != 0 ) return std::string(); - //boost::filesystem::create_directories(kernel_cache_path); - } - return std::string(kernel_cache_path); -} - GBJitCache::GBJitCache() { } GBJitCache::~GBJitCache() { } -//void GBJitCache::macrofy() { -// printf("GOT HERE and shouldn't have!\n"); -//} - - std::mutex GBJitCache::_kernel_cache_mutex; std::mutex GBJitCache::_program_cache_mutex; diff --git a/GraphBLAS/CUDA/GB_jit_cache.h b/GraphBLAS/CUDA/GB_cuda_jitify_cache.h similarity index 96% rename from GraphBLAS/CUDA/GB_jit_cache.h rename to GraphBLAS/CUDA/GB_cuda_jitify_cache.h index 8f7f762262..36124da469 100644 --- a/GraphBLAS/CUDA/GB_jit_cache.h +++ b/GraphBLAS/CUDA/GB_cuda_jitify_cache.h @@ -1,3 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/GB_cuda_jitify_cache.h +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + /* * Copyright (c) 2019,2020 NVIDIA CORPORATION. * @@ -31,8 +39,6 @@ namespace jit { std::string get_user_home_cache_dir(); -std::string get_user_graphblas_source_path(); -std::string getCacheDir(void); template using named_prog = std::pair>; @@ -217,7 +223,7 @@ class GBJitCache else { // Find file cached T object bool successful_read = false; std::string serialized; - std::string cache_dir = getCacheDir(); + std::string cache_dir = get_user_home_cache_dir(); std::string file_name = cache_dir + "/" + name; if (not cache_dir.empty() ) { // TODO: Use OS-agnostic path separator here @@ -277,7 +283,7 @@ class GBJitCache bool successful_read = false; std::string serialized; #if defined(JITIFY_USE_CACHE) - std::string cache_dir = getCacheDir(); + std::string cache_dir = get_user_home_cache_dir() ; if (not cache_dir.empty() ) { // TODO: Use OS-agnostic path separator std::string file_name = cache_dir + "/" + name; diff --git a/GraphBLAS/CUDA/GB_jit_launcher.cu b/GraphBLAS/CUDA/GB_cuda_jitify_launcher.cu similarity index 81% rename from GraphBLAS/CUDA/GB_jit_launcher.cu rename to GraphBLAS/CUDA/GB_cuda_jitify_launcher.cu index 8875a3a1a0..207ce5120b 100644 --- a/GraphBLAS/CUDA/GB_jit_launcher.cu +++ b/GraphBLAS/CUDA/GB_cuda_jitify_launcher.cu @@ -1,3 +1,10 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/GB_cuda_jitify_launcher.cu +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ /* * Copyright (c) 2019,2020 NVIDIA CORPORATION. @@ -18,7 +25,7 @@ * limitations under the License. */ -#include +#include "GB_cuda_jitify_launcher.h" #include namespace jit { diff --git a/GraphBLAS/CUDA/GB_jit_launcher.h b/GraphBLAS/CUDA/GB_cuda_jitify_launcher.h similarity index 87% rename from GraphBLAS/CUDA/GB_jit_launcher.h rename to GraphBLAS/CUDA/GB_cuda_jitify_launcher.h index 1ef0736264..088a2bd77a 100644 --- a/GraphBLAS/CUDA/GB_jit_launcher.h +++ b/GraphBLAS/CUDA/GB_cuda_jitify_launcher.h @@ -1,5 +1,13 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/GB_cuda_jitify_launcher.h +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + /* - * Copyright (c) 2019,2020 NVIDIA CORPORATION. + * Copyright (c) 2019,2023 NVIDIA CORPORATION. * * Copyright 2018-2019 BlazingDB, Inc. * Copyright 2018 Christian Noboa Mardini @@ -17,10 +25,15 @@ * limitations under the License. */ -#ifndef GB_JIT_LAUNCHER_H -#define GB_JIT_LAUNCHER_H +//------------------------------------------------------------------------------ + +// FIXME: rename .hpp? + +#ifndef GB_CUDA_JITIFY_LAUNCHER_H +#define GB_CUDA_JITIFY_LAUNCHER_H + +#include "GB_cuda_jitify_cache.h" -#include #include #include #include @@ -43,26 +56,6 @@ namespace jit { -#if 0 -const std::vector GB_jit_cuda_compiler_flags{ - "-std=c++17", - "--use_fast_math", - "-remove-unused-globals", - "-w", - "-lcudart", - "-D__CUDACC_RTC__", - "-I.", - "-I..", - "-I../../Include", - "-I../../Source", - "-I../../Source/Template", -// "-Ilocal_cub/block", - "-Itemplates", - "-I/usr/local/cuda/include" // FIXME: remove this? -}; -#endif - - /** * @brief Class used to handle compilation and execution of JIT kernels * diff --git a/GraphBLAS/CUDA/GB_cuda_matrix_prefetch.cpp b/GraphBLAS/CUDA/GB_cuda_matrix_prefetch.cpp index 2b6bfadd6b..c71dc0cd6c 100644 --- a/GraphBLAS/CUDA/GB_cuda_matrix_prefetch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_matrix_prefetch.cpp @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ -// GB_cuda_matrix_prefetch: prefetch a matrix to a GPU or the CPU +// GraphBLAS/CUDA/GB_cuda_matrix_prefetch: prefetch a matrix to a GPU or the CPU //------------------------------------------------------------------------------ +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. -// http://suitesparse.com See GraphBLAS/Doc/License.txt for license. //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_mxm_dot3_jitFactory.hpp b/GraphBLAS/CUDA/GB_cuda_mxm_dot3_jitFactory.hpp index e517f2439b..3fce511b40 100644 --- a/GraphBLAS/CUDA/GB_cuda_mxm_dot3_jitFactory.hpp +++ b/GraphBLAS/CUDA/GB_cuda_mxm_dot3_jitFactory.hpp @@ -1,8 +1,11 @@ //------------------------------------------------------------------------------ -// GB_cuda_mxm_dot3_factory +// GraphBLAS/CUDA/GB_cuda_mxm_dot3_jitFactory.hpp //------------------------------------------------------------------------------ // SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + /* * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. * @@ -31,21 +34,21 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -//------------------------------------------------------------------------------ - #ifndef GB_MXM_DOT3_JITFACTORY_H #define GB_MXM_DOT3_JITFACTORY_H #pragma once /** - * This file is responsible for picking all the parameters and what kernel variaiton we will use for a given instance + * This file is responsible for picking all the parameters and what kernel + * variaiton we will use for a given instance * - data types * - semiring types * - binary ops * - monoids * - * Kernel factory says "Here's the actual instance I want you to build with the given parameters" + * Kernel factory says "Here's the actual instance I want you to build with the + * given parameters" */ @@ -69,7 +72,7 @@ class dense_phase1launchFactory { // FIXME: this is the full name. Why? See below for partial name. // Need to be consistent in naming schemes. - std::string kernel_name = "GB_jit_AxB_dot3_dense_phase1"; + std::string kernel_name = "GB_cuda_jit_AxB_dot3_dense_phase1"; GB_cuda_mxm_factory &mxm_factory_; @@ -114,21 +117,21 @@ class dense_phase1launchFactory std::stringstream string_to_be_jitted ; - // FIXME: why does "templates/" appear here but not elsewhere? string_to_be_jitted << kernel_name << std::endl << R"(#include "GB_cuda_kernel.h")" << std::endl << - R"(#include ")" << jit::get_user_home_cache_dir() << "/" << mxm_factory_.filename << R"(")" << std::endl << - R"(#include "templates/)" << kernel_name << R"(.cuh")" << std::endl; + R"(#include ")" << mxm_factory_.filename << R"(")" << std::endl << + R"(#include ")" << kernel_name << R"(.cuh")" << std::endl; bool result = false; dim3 grid(get_number_of_blocks(M)); dim3 block(get_threads_per_block()); + std::cout << "HERE I AM 7" << std::endl ; jit::launcher( kernel_name + "_" + sr_code_str + ".jtfy", string_to_be_jitted.str(), header_names, - GB_jit_cuda_compiler_flags, + GB_cuda_jit_compiler_flags ( ), file_callback /* FIXME: make NULL */) .set_kernel_inst( kernel_name, template_types) .configure(grid, block, SMEM, stream) @@ -151,7 +154,7 @@ class dense_phase1launchFactory template class phase1launchFactory { - std::string kernel_name = "GB_jit_AxB_dot3_phase1"; + std::string kernel_name = "GB_cuda_jit_AxB_dot3_phase1"; GB_cuda_mxm_factory &mxm_factory_; @@ -197,25 +200,39 @@ class phase1launchFactory std::stringstream string_to_be_jitted ; - // FIXME: why does "templates/" appear here but not elsewhere? string_to_be_jitted << kernel_name << std::endl << R"(#include "GB_cuda_kernel.h")" << std::endl << - R"(#include ")" << jit::get_user_home_cache_dir() << "/" << mxm_factory_.filename << R"(")" << std::endl << - R"(#include "templates/)" << kernel_name << R"(.cuh")" << std::endl; + R"(#include ")" << mxm_factory_.filename << R"(")" << std::endl << + R"(#include ")" << kernel_name << R"(.cuh")" << std::endl; + + std::cout << "header names:" << std::endl ; +// std::cout << header_names << std::endl ; + for (std::string s : header_names) + { + std::cout << " " << s << std::endl ; + } +// std::cout << "string_to_be_jitted :" << std::endl ; +// std::cout << string_to_be_jitted << std::endl ; + std::cout << "GB_cuda_jit_compiler_flags ( ):" << std::endl ; + for (std::string s : GB_cuda_jit_compiler_flags ( )) + { + std::cout << " " << s << std::endl ; + } + std::cout << "kernel_name + sr_code_str .jtfy:" << std::endl ; + std::cout << kernel_name + "_" + sr_code_str + ".jtfy" << std::endl ; + std::cout << "jit::get_user_home_cache_dir ( ):" << std::endl ; + std::cout << jit::get_user_home_cache_dir ( ) << std::endl ; bool result = false; - - // std::cout<< "GB_jit_cuda_compiler_flags "; - // for ( std::string s : GB_jit_cuda_compiler_flags) - // std::cout<< s<< std::endl; dim3 grid(get_number_of_blocks(M)); dim3 block(get_threads_per_block()); + std::cout << "HERE I AM 1" << std::endl ; jit::launcher( kernel_name + "_" + sr_code_str + ".jtfy", string_to_be_jitted.str(), header_names, - GB_jit_cuda_compiler_flags, + GB_cuda_jit_compiler_flags ( ), file_callback) .set_kernel_inst( kernel_name, template_types) .configure(grid, block, SMEM, stream) @@ -235,7 +252,7 @@ template class phase2launchFactory { - std::string base_name = "GB_jit"; + std::string base_name = "GB_cuda_jit"; // FIXME: this is the partial name. Why? See above. std::string kernel_name = "AxB_phase2"; @@ -274,10 +291,11 @@ class phase2launchFactory R"(#include ")" << hashable_name << R"(.cuh")" << std::endl; const int64_t mnz = GB_nnz (M) ; + std::cout << "HERE I AM 2" << std::endl ; jit::launcher( hashable_name, string_to_be_jitted.str(), header_names, - GB_jit_cuda_compiler_flags, + GB_cuda_jit_compiler_flags ( ), file_callback) .set_kernel_inst( kernel_name, {}) .configure(grid, block, SMEM, stream) @@ -299,7 +317,7 @@ template< int threads_per_block = 32, int chunk_size = 128> class phase2endlaunchFactory { - std::string base_name = "GB_jit"; + std::string base_name = "GB_cuda_jit"; std::string kernel_name = "AxB_phase2end"; public: @@ -332,10 +350,11 @@ class phase2endlaunchFactory string_to_be_jitted << hashable_name << std::endl << R"(#include ")" << hashable_name << R"(.cuh")" << std::endl; + std::cout << "HERE I AM 3" << std::endl ; jit::launcher( hashable_name, string_to_be_jitted.str(), header_names, - GB_jit_cuda_compiler_flags, + GB_cuda_jit_compiler_flags ( ), file_callback) .set_kernel_inst( kernel_name , {}) .configure(grid, block, SMEM, stream) @@ -355,7 +374,7 @@ class phase2endlaunchFactory class mxm_dense_launchFactory { - std::string base_name = "GB_jit"; + std::string base_name = "GB_cuda_jit"; std::string kernel_name = "AxB_dot3_phase3_dndn"; GB_cuda_mxm_factory &mxm_factory_; @@ -409,17 +428,18 @@ class mxm_dense_launchFactory string_to_be_jitted << hashable_name << std::endl << R"(#include "GB_cuda_kernel.h")" << std::endl << - R"(#include ")" << jit::get_user_home_cache_dir() << "/" << mxm_factory_.filename << R"(")" << std::endl << + R"(#include ")" << mxm_factory_.filename << R"(")" << std::endl << R"(#include ")" << hashable_name << R"(.cuh")" << std::endl; dim3 grid(gridsz); dim3 block(blocksz); GBURBLE ("(GPU dot3 mxm dense launch nblocks,blocksize= %d,%d )\n", gridsz,blocksz) ; + std::cout << "HERE I AM 4" << std::endl ; jit::launcher( hashable_name + "_" + sr_code, string_to_be_jitted.str(), header_names, - GB_jit_cuda_compiler_flags, + GB_cuda_jit_compiler_flags ( ), file_callback) .set_kernel_inst(final_kernel_name_ss.str(), template_types ) // { C->type->name, @@ -466,7 +486,7 @@ class mxm_dense_launchFactory class mxm_sparse_dense_launchFactory { - std::string base_name = "GB_jit"; + std::string base_name = "GB_cuda_jit"; std::string kernel_name = "AxB_dot3"; GB_cuda_mxm_factory &mxm_factory_; @@ -520,17 +540,18 @@ class mxm_sparse_dense_launchFactory string_to_be_jitted << hashable_name << std::endl << R"(#include "GB_cuda_kernel.h")" << std::endl << - R"(#include ")" << jit::get_user_home_cache_dir() << "/" << mxm_factory_.filename << R"(")" << std::endl << + R"(#include ")" << mxm_factory_.filename << R"(")" << std::endl << R"(#include ")" << hashable_name << R"(.cuh")" << std::endl; dim3 grid(gridsz); dim3 block(blocksz); GBURBLE ("(GPU dot3 mxm sparse_dense launch nblocks,blocksize= %d,%d )\n", gridsz,blocksz) ; + std::cout << "HERE I AM 5" << std::endl ; jit::launcher( hashable_name + "_" + sr_code, string_to_be_jitted.str(), header_names, - GB_jit_cuda_compiler_flags, + GB_cuda_jit_compiler_flags ( ), file_callback) .set_kernel_inst(final_kernel_name_ss.str(), template_types ) // { C->type->name, @@ -577,7 +598,7 @@ class mxm_sparse_dense_launchFactory class phase3launchFactory { - std::string base_name = "GB_jit"; + std::string base_name = "GB_cuda_jit"; std::string kernel_name = "AxB_dot3"; GB_cuda_mxm_factory &mxm_factory_; @@ -638,7 +659,7 @@ class phase3launchFactory // FIXME: why is "hashable_name" used sometimes, and sometimes "kernel_name"? string_to_be_jitted << hashable_name << std::endl << R"(#include "GB_cuda_kernel.h")" << std::endl << - R"(#include ")" << jit::get_user_home_cache_dir() << "/" << mxm_factory_.filename << R"(")" << std::endl << + R"(#include ")" << mxm_factory_.filename << R"(")" << std::endl << R"(#include ")" << hashable_name << R"(.cuh")" << std::endl; dim3 grid(gridsz); @@ -646,10 +667,11 @@ class phase3launchFactory GBURBLE ("(GPU phase3 launch %s st,end=%ld,%ld nblocks,blocksize= %d,%d )\n", this->Opname.c_str(), start,end,gridsz,blocksz) ; + std::cout << "HERE I AM 6" << std::endl ; jit::launcher( hashable_name + "_" + sr_code, string_to_be_jitted.str(), header_names, - GB_jit_cuda_compiler_flags, + GB_cuda_jit_compiler_flags ( ), file_callback) .set_kernel_inst(final_kernel_name_ss.str(), template_types ) // { C->type->name, diff --git a/GraphBLAS/CUDA/GB_cuda_mxm_factory.hpp b/GraphBLAS/CUDA/GB_cuda_mxm_factory.hpp index b4916b1f59..227b776f65 100644 --- a/GraphBLAS/CUDA/GB_cuda_mxm_factory.hpp +++ b/GraphBLAS/CUDA/GB_cuda_mxm_factory.hpp @@ -1,20 +1,22 @@ //------------------------------------------------------------------------------ -// GB_cuda_mxm_factory: construct code and header file for GrB_mxm jit kernel +// GraphBLAS/CUDA/GB_cuda_mxm_factory.hpp +//------------------------------------------------------------------------------ + +// (c) Nvidia Corp. 2023 All rights reserved +// SPDX-License-Identifier: Apache-2.0 + //------------------------------------------------------------------------------ // Class to manage both stringify functions from mxm, ops and monoids to a // header file. -// (c) Nvidia Corp. 2020 All rights reserved -// SPDX-License-Identifier: Apache-2.0 - // Implementations of string callbacks #pragma once // FIXME do we need the iostrean any more? #include #include -#include "GB_jit_cache.h" +#include "GB_cuda_jitify_cache.h" extern "C" { diff --git a/GraphBLAS/CUDA/GB_cuda_reduce_factory.hpp b/GraphBLAS/CUDA/GB_cuda_reduce_factory.hpp index 4cef44adf8..e0f7aae75b 100644 --- a/GraphBLAS/CUDA/GB_cuda_reduce_factory.hpp +++ b/GraphBLAS/CUDA/GB_cuda_reduce_factory.hpp @@ -1,5 +1,10 @@ //------------------------------------------------------------------------------ -// GraphBLAS/CUDA/GB_cuda_reduce_factory +// GraphBLAS/CUDA/GB_cuda_reduce_factory.hpp +//------------------------------------------------------------------------------ + +// (c) Nvidia Corp. 2023 All rights reserved +// SPDX-License-Identifier: Apache-2.0 + //------------------------------------------------------------------------------ // Class to manage both stringify functions from mxm, ops and monoids to a @@ -9,18 +14,13 @@ // Also provides a iostream callback to deliver the buffer to jitify as // if read from a file -// (c) Nvidia Corp. 2020 All rights reserved -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - // Implementations of string callbacks #pragma once // FIXME: do we use iostream? #include #include -#include "GB_jit_cache.h" +#include "GB_cuda_jitify_cache.h" extern "C" { diff --git a/GraphBLAS/CUDA/GB_cuda_reduce_jitFactory.hpp b/GraphBLAS/CUDA/GB_cuda_reduce_jitFactory.hpp index 4e1008a920..fd618bddf0 100644 --- a/GraphBLAS/CUDA/GB_cuda_reduce_jitFactory.hpp +++ b/GraphBLAS/CUDA/GB_cuda_reduce_jitFactory.hpp @@ -3,8 +3,9 @@ //------------------------------------------------------------------------------ // SPDX-License-Identifier: Apache-2.0 + /* - * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2023, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -68,7 +69,7 @@ class reduceFactory // class properties //-------------------------------------------------------------------------- - std::string base_name = "GB_jit"; + std::string base_name = "GB_cuda_jit"; std::string kernel_name = "reduce"; int threads_per_block = 320 ; @@ -144,11 +145,9 @@ class reduceFactory std::string hashable_name = base_name + "_" + kernel_name; std::stringstream string_to_be_jitted ; - string_to_be_jitted << - hashable_name << std::endl << + string_to_be_jitted << hashable_name << std::endl << R"(#include "GB_cuda_kernel.h")" << std::endl << - R"(#include ")" << jit::get_user_home_cache_dir() << "/" - << reduce_factory_.filename << R"(")" << std::endl << + R"(#include ")" << reduce_factory_.filename << R"(")" << std::endl << R"(#include ")" << hashable_name << R"(.cuh")" << std::endl; int64_t anvals = GB_nnz_held (A) ; @@ -198,7 +197,7 @@ class reduceFactory jit::launcher(hashable_name + "_" + rcode, string_to_be_jitted.str(), header_names, - GB_jit_cuda_compiler_flags, + GB_cuda_jit_compiler_flags ( ), file_callback) // FIXME: where is file_callback defined? .set_kernel_inst( hashable_name , { A->type->name, monoid->op->ztype->name }) diff --git a/GraphBLAS/CUDA/GB_reduce_to_scalar_cuda_branch.cpp b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_branch.cpp similarity index 87% rename from GraphBLAS/CUDA/GB_reduce_to_scalar_cuda_branch.cpp rename to GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_branch.cpp index 455dd0ab19..f336ce8002 100644 --- a/GraphBLAS/CUDA/GB_reduce_to_scalar_cuda_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_branch.cpp @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_reduce_to_scalar_cuda_branch: when to use GPU for scalar reduction +// GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_branch: decide to use GPU for reduce //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,7 @@ #include "GB_cuda.h" -bool GB_reduce_to_scalar_cuda_branch // return true to use the GPU +bool GB_cuda_reduce_to_scalar_branch // return true to use the GPU ( const GrB_Monoid monoid, // monoid to do the reduction const GrB_Matrix A // input matrix diff --git a/GraphBLAS/CUDA/GB_reduce_to_scalar_cuda.cpp b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_jit.cpp similarity index 88% rename from GraphBLAS/CUDA/GB_reduce_to_scalar_cuda.cpp rename to GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_jit.cpp index 2f3443217e..0d7c6578b0 100644 --- a/GraphBLAS/CUDA/GB_reduce_to_scalar_cuda.cpp +++ b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_jit.cpp @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_reduce_to_scalar_cuda.cpp: reduce on the GPU with semiring +// GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_jit: reduce on the GPU with semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,20 +14,19 @@ // threadblock. Then GB_reduce_to_scalar on the CPU sees this V as the result, // and calls itself recursively to continue the reduction. -#include "GraphBLAS.h" -#undef I +#include "GraphBLAS_cuda.h" + extern "C" { #include "GB_reduce.h" } #include "GB_cuda.h" -#include "GB_jit_cache.h" +#include "GB_cuda_jitify_cache.h" #include "GB_cuda_common_jitFactory.hpp" #include "GB_cuda_reduce_jitFactory.hpp" -#include "GB_cuda_type_wrap.hpp" -GrB_Info GB_reduce_to_scalar_cuda +GrB_Info GB_cuda_reduce_to_scalar_jit ( // output: GB_void *s, // note: statically allocated on CPU stack; if diff --git a/GraphBLAS/CUDA/GB_cuda_type_bits.c b/GraphBLAS/CUDA/GB_cuda_type_bits.c index 52b446a4ea..17de151f3f 100644 --- a/GraphBLAS/CUDA/GB_cuda_type_bits.c +++ b/GraphBLAS/CUDA/GB_cuda_type_bits.c @@ -1,6 +1,13 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/GB_cuda_type_bits +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -#if 0 +//------------------------------------------------------------------------------ + +#undef GBCUDA_CPLUSPLUS #include "GB.h" size_t GB_cuda_type_bits (GB_Type_code); @@ -26,4 +33,3 @@ size_t GB_cuda_type_bits (GB_Type_code type_code) } } -#endif diff --git a/GraphBLAS/CUDA/GB_cuda_type_branch.cpp b/GraphBLAS/CUDA/GB_cuda_type_branch.cpp index 19e666f6ad..ba268b2a33 100644 --- a/GraphBLAS/CUDA/GB_cuda_type_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_type_branch.cpp @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_cuda_type_branch: decide if GPU can be used on the given type +// GraphBLAS/CUDA/GB_cuda_type_branch: decide if GPU can be used on a type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,12 +14,6 @@ // All built-in types pass this rule. -#include "GraphBLAS.h" -#undef I -extern "C" -{ - #include "GB.h" -} #include "GB_cuda.h" bool GB_cuda_type_branch // return true if the type is OK on GPU diff --git a/GraphBLAS/CUDA/GB_cuda_upscale_identity.cpp b/GraphBLAS/CUDA/GB_cuda_upscale_identity.cpp index 1a8c9c7a50..d7d5ec8a9e 100644 --- a/GraphBLAS/CUDA/GB_cuda_upscale_identity.cpp +++ b/GraphBLAS/CUDA/GB_cuda_upscale_identity.cpp @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_cuda_upscale_identity: return the identity, at least 16 bits in size +// GraphBLAS/CUDA/GB_cuda_upscale_identity: return identity, >= 16 bits in size //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, 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 ab82374238..4b8016e59c 100644 --- a/GraphBLAS/CUDA/GB_cuda_warmup.cu +++ b/GraphBLAS/CUDA/GB_cuda_warmup.cu @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_cuda_warmup.cu: warmup the GPU +// GraphBLAS/CUDA/GB_cuda_warmup.cu: warmup the GPU //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GraphBLAS_cuda.h b/GraphBLAS/CUDA/GraphBLAS_cuda.h new file mode 100644 index 0000000000..4bb6872dc4 --- /dev/null +++ b/GraphBLAS/CUDA/GraphBLAS_cuda.h @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/GraphBLAS_cuda.h +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GXB_COMPLEX_H +#define GXB_COMPLEX_H + + // C++ complex types for CUDA + #include + #include + typedef std::complex GxB_FC32_t ; + typedef std::complex GxB_FC64_t ; + #define GxB_CMPLXF(r,i) GxB_FC32_t(r,i) + #define GxB_CMPLX(r,i) GxB_FC64_t(r,i) + #define GB_HAS_CMPLX_MACROS 1 + +#endif + +#define GB_LIBRARY +#include "GraphBLAS.h" +#undef I + diff --git a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_dense_phase1.cuh b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_dense_phase1.cuh similarity index 96% rename from GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_dense_phase1.cuh rename to GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_dense_phase1.cuh index 6c322ec078..2d971a5ecc 100644 --- a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_dense_phase1.cuh +++ b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_dense_phase1.cuh @@ -1,7 +1,12 @@ //------------------------------------------------------------------------------ -// GB_jit_AxB_dot3_dense_phase1: phase1 for dot3, A and B are bitmap/full +// GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_dense_phase1.cuh //------------------------------------------------------------------------------ +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// phase1 for dot3, A and B are bitmap/full // dense phase1: symbolic load balancing and data partition // to assign work to different 'buckets' for later compute diff --git a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase1.cuh b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase1.cuh similarity index 91% rename from GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase1.cuh rename to GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase1.cuh index c2654ca296..23b6b272aa 100644 --- a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase1.cuh +++ b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase1.cuh @@ -1,7 +1,13 @@ //------------------------------------------------------------------------------ -// template/GB_jit_AxB_dot3_phase1.cuh: build nanobuckets, hunt for pre-zombies +// GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase1.cuh //------------------------------------------------------------------------------ +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// build nanobuckets, hunt for pre-zombies + // dot3, phase1: symbolic load balancing and data partition // to assign work to different 'buckets' for later compute @@ -80,14 +86,12 @@ __global__ void GB_jit_AxB_dot3_phase1 const bool M_is_hyper = M->h != NULL ; ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; - const int64_t *__restrict__ Ah = A->h ; const int64_t *__restrict__ Ap = A->p ; const int64_t *__restrict__ Ai = A->i ; const int64_t avlen = A->vlen ; // const int64_t anz = GB_nnz(A) ; const GB_A_NVALS (anz) ; - const int64_t *__restrict__ Bh = B->h ; const int64_t *__restrict__ Bp = B->p ; const int64_t *__restrict__ Bi = B->i ; const int64_t bvlen = B->vlen ; @@ -95,17 +99,23 @@ __global__ void GB_jit_AxB_dot3_phase1 const GB_B_NVALS (bnz) ; #if GB_A_IS_HYPER - const int64_t *__restrict__ A_Yp = A->Y->p ; - const int64_t *__restrict__ A_Yi = A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) A->Y->x ; - const int64_t A_hash_bits = A->Y->vdim - 1 ; + 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 int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER - const int64_t *__restrict__ B_Yp = B->Y->p ; - const int64_t *__restrict__ B_Yi = B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) B->Y->x ; - const int64_t B_hash_bits = B->Y->vdim - 1 ; + 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 int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif // int64_t *restrict Cp = C->p ; // copy of Mp @@ -220,8 +230,8 @@ __global__ void GB_jit_AxB_dot3_phase1 int64_t pB, pB_end ; #if GB_B_IS_HYPER - GB_hyper_hash_lookup (Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, - j, &pB, &pB_end) ; + GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, + B_hash_bits, j, &pB, &pB_end) ; #elif GB_B_IS_SPARSE pB = Bp[j] ; pB_end = Bp[j+1] ; @@ -241,8 +251,8 @@ __global__ void GB_jit_AxB_dot3_phase1 int64_t pA, pA_end ; #if GB_A_IS_HYPER - GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, - i, &pA, &pA_end) ; + GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, + A_hash_bits, i, &pA, &pA_end) ; #elif GB_A_IS_SPARSE pA = Ap[i] ; pA_end = Ap[i+1] ; diff --git a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_dndn.cuh b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh similarity index 97% rename from GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_dndn.cuh rename to GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh index 1a94693f23..80a4e2020b 100644 --- a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_dndn.cuh +++ b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh @@ -1,5 +1,9 @@ //------------------------------------------------------------------------------ -// GB_jit_AxB_dot3_phase3_dndn.cuh: +// GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + //------------------------------------------------------------------------------ // This CUDA kernel produces the semiring product of two diff --git a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_mp.cuh b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_mp.cuh similarity index 92% rename from GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_mp.cuh rename to GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_mp.cuh index 267b41b419..838b7e4ccf 100644 --- a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_mp.cuh +++ b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_mp.cuh @@ -1,5 +1,10 @@ //------------------------------------------------------------------------------ -// AxB_dot3_phase3_mp.cu +// GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_mp.cuh +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + //------------------------------------------------------------------------------ // This CUDA kernel produces the semi-ring product of two @@ -78,7 +83,7 @@ template< typename T_C, typename T_A, typename T_B, typename T_Z, typename T_X, typename T_Y, uint64_t srcode> -__global__ void AxB_dot3_phase3_mp +__global__ void AxB_dot3_phase3_mp // FIXME rename ( int64_t start, int64_t end, @@ -114,17 +119,23 @@ __global__ void AxB_dot3_phase3_mp ASSERT (GB_B_IS_HYPER || GB_B_IS_SPARSE) ; #if GB_A_IS_HYPER - const int64_t *__restrict__ A_Yp = A->Y->p ; - const int64_t *__restrict__ A_Yi = A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) A->Y->x ; - const int64_t A_hash_bits = A->Y->vdim - 1 ; + 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 int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER - const int64_t *__restrict__ B_Yp = B->Y->p ; - const int64_t *__restrict__ B_Yi = B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) B->Y->x ; - const int64_t B_hash_bits = B->Y->vdim - 1 ; + 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 int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif // zombie count @@ -162,7 +173,7 @@ __global__ void AxB_dot3_phase3_mp // find A(:,i) int64_t pA_start, pA_end ; #if GB_A_IS_HYPER - GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, i, &pA_start, &pA_end) ; #else pA_start = Ap[i] ; @@ -192,7 +203,7 @@ __global__ void AxB_dot3_phase3_mp // find B(:,j) int64_t pB_start, pB_end ; #if GB_B_IS_HYPER - GB_hyper_hash_lookup (Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, j, &pB_start, &pB_end) ; #else pB_start = Bp[j] ; @@ -331,7 +342,7 @@ __global__ void AxB_dot3_phase3_mp #else if (Aind == Bind) { - // cij += aki + bkj + // cij += aki * bkj GB_DOT_MERGE (pA + pA_start, pB + pB_start) ; // TODO check terminal condition, using tile.any } diff --git a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_spdn.cuh b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh similarity index 89% rename from GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_spdn.cuh rename to GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh index 499a5f386f..e8986d86cf 100644 --- a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_spdn.cuh +++ b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh @@ -1,5 +1,9 @@ //------------------------------------------------------------------------------ -// AxB_dot3_phase3_spdn.cu +// GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + //------------------------------------------------------------------------------ // This CUDA kernel produces the semi-ring product of two @@ -67,7 +71,7 @@ template< typename T_C, typename T_A, typename T_B, typename T_Z, typename T_X, typename T_Y, uint64_t srcode> -__global__ void AxB_dot3_phase3_spdn +__global__ void AxB_dot3_phase3_spdn // FIXME rename ( int64_t start, int64_t end, @@ -113,17 +117,23 @@ __global__ void AxB_dot3_phase3_spdn #endif #if GB_A_IS_HYPER - const int64_t *__restrict__ A_Yp = A->Y->p ; - const int64_t *__restrict__ A_Yi = A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) A->Y->x ; - const int64_t A_hash_bits = A->Y->vdim - 1 ; + 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 int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER - const int64_t *__restrict__ B_Yp = B->Y->p ; - const int64_t *__restrict__ B_Yi = B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) B->Y->x ; - const int64_t B_hash_bits = B->Y->vdim - 1 ; + 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 int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif // zombie count @@ -151,7 +161,7 @@ __global__ void AxB_dot3_phase3_spdn // find A(:,i) int64_t pA, pA_end ; #if GB_A_IS_HYPER - GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, i, &pA, &pA_end) ; #elif GB_A_IS_SPARSE pA = Ap[i] ; @@ -171,7 +181,7 @@ __global__ void AxB_dot3_phase3_spdn // find B(:,j) int64_t pB, pB_end ; #if GB_B_IS_HYPER - GB_hyper_hash_lookup (Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, j, &pB, &pB_end) ; #elif GB_B_IS_SPARSE pB = Bp[j] ; diff --git a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_vsdn.cuh b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh similarity index 87% rename from GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_vsdn.cuh rename to GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh index d5713d5e1c..e5168527e0 100644 --- a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_vsdn.cuh +++ b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh @@ -1,3 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + //****************************************************************************** // Sparse dot products in batch form, sparse - dense case. // Each thread in this kernel is responsible for m vector-pairs(x,y), @@ -98,17 +106,23 @@ __global__ void AxB_dot3_phase3_vsdn #endif #if GB_A_IS_HYPER - const int64_t *__restrict__ A_Yp = A->Y->p ; - const int64_t *__restrict__ A_Yi = A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) A->Y->x ; - const int64_t A_hash_bits = A->Y->vdim - 1 ; + 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 int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER - const int64_t *__restrict__ B_Yp = B->Y->p ; - const int64_t *__restrict__ B_Yi = B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) B->Y->x ; - const int64_t B_hash_bits = B->Y->vdim - 1 ; + 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 int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif // typedef cub::BlockReduce BlockReduce; @@ -147,7 +161,7 @@ __global__ void AxB_dot3_phase3_vsdn // find A(:,i) int64_t pA, pA_end ; #if GB_A_IS_HYPER - GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, i, &pA, &pA_end) ; #elif GB_A_IS_SPARSE pA = Ap[i] ; @@ -161,7 +175,7 @@ __global__ void AxB_dot3_phase3_vsdn // find B(:,j) int64_t pB, pB_end ; #if GB_B_IS_HYPER - GB_hyper_hash_lookup (Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, j, &pB, &pB_end) ; #elif GB_B_IS_SPARSE pB = Bp[j]; // col of C diff --git a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_vsvs.cuh b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh similarity index 85% rename from GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_vsvs.cuh rename to GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh index 02a94eeeb6..bcd0d4d25c 100644 --- a/GraphBLAS/CUDA/templates/GB_jit_AxB_dot3_phase3_vsvs.cuh +++ b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh @@ -1,3 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + //****************************************************************************** // Sparse dot version of Matrix-Matrix multiply with mask // Each thread in this kernel is responsible for m vector-pairs(x,y), @@ -145,17 +153,23 @@ __global__ void AxB_dot3_phase3_vsvs #endif #if GB_A_IS_HYPER - const int64_t *__restrict__ A_Yp = A->Y->p ; - const int64_t *__restrict__ A_Yi = A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) A->Y->x ; - const int64_t A_hash_bits = A->Y->vdim - 1 ; + 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 int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER - const int64_t *__restrict__ B_Yp = B->Y->p ; - const int64_t *__restrict__ B_Yi = B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) B->Y->x ; - const int64_t B_hash_bits = B->Y->vdim - 1 ; + 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 int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif //int64_t pfirst, plast; @@ -184,7 +198,7 @@ __global__ void AxB_dot3_phase3_vsvs // find A(:,i): A is always sparse or hypersparse int64_t pA, pA_end ; #if GB_A_IS_HYPER - GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, i, &pA, &pA_end) ; #else pA = Ap[i] ; @@ -194,7 +208,7 @@ __global__ void AxB_dot3_phase3_vsvs // find B(:,j): B is always sparse or hypersparse int64_t pB, pB_end ; #if GB_B_IS_HYPER - GB_hyper_hash_lookup (Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, j, &pB, &pB_end) ; #else pB = Bp[j] ; diff --git a/GraphBLAS/CUDA/templates/GB_jit_AxB_phase2.cuh b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_phase2.cuh similarity index 94% rename from GraphBLAS/CUDA/templates/GB_jit_AxB_phase2.cuh rename to GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_phase2.cuh index 23ea6d85a2..3d9f7d39cb 100644 --- a/GraphBLAS/CUDA/templates/GB_jit_AxB_phase2.cuh +++ b/GraphBLAS/CUDA/JitKernels/GB_cuda_jit_AxB_phase2.cuh @@ -1,8 +1,13 @@ //------------------------------------------------------------------------------ -// templates/GB_AxB_cuda_dot3_phase2: fill the global buckets +// GraphBLAS/CUDA/JitKernels/GB_cuda_jit_GB_AxB_phase2.cuh +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// fill the global buckets //------------------------------------------------------------------------------ -// TODO describe me #pragma once #include "GB_cuda_kernel.h" #include "GB_mxm_shared_definitions.h" @@ -114,7 +119,7 @@ __inline__ __device__ uint64_t warp_ReduceSumPlus_uint64( thread_block_tile -__global__ void GB_jit_reduce +__global__ void GB_jit_reduce // FIXME rename ( GrB_Matrix A, // matrix to reduce void *zscalar, // scalar result, at least sizeof (uint32_t) diff --git a/GraphBLAS/CUDA/GB_cuda_atomics.cuh b/GraphBLAS/CUDA/Template/GB_cuda_atomics.cuh similarity index 99% rename from GraphBLAS/CUDA/GB_cuda_atomics.cuh rename to GraphBLAS/CUDA/Template/GB_cuda_atomics.cuh index abb96591e9..9eeddf43dc 100644 --- a/GraphBLAS/CUDA/GB_cuda_atomics.cuh +++ b/GraphBLAS/CUDA/Template/GB_cuda_atomics.cuh @@ -1,9 +1,11 @@ //------------------------------------------------------------------------------ -// GraphBLAS/CUDA/GB_cuda_atomics: CUDA atomics for GraphBLAS +// GraphBLAS/CUDA/Template/GB_cuda_atomics.cuh: CUDA atomics for GraphBLAS //------------------------------------------------------------------------------ +// yet still more stuff here + /* - * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2023, 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/GB_cuda_buckets.h b/GraphBLAS/CUDA/Template/GB_cuda_buckets.h similarity index 86% rename from GraphBLAS/CUDA/GB_cuda_buckets.h rename to GraphBLAS/CUDA/Template/GB_cuda_buckets.h index d818b2dc68..57cc9ebc4a 100644 --- a/GraphBLAS/CUDA/GB_cuda_buckets.h +++ b/GraphBLAS/CUDA/Template/GB_cuda_buckets.h @@ -1,13 +1,13 @@ //------------------------------------------------------------------------------ -// GB_cuda_buckets.h: definitions for buckets using for dot3 +// GraphBLAS/CUDA/Template/GB_cuda_buckets.h: bucket definitions for dot3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -//------------------------------------------------------------------------------ +// FIXME: rename this file to GB_cuda_dot3_buckets.h (or .cuh? .hpp?) -// This file is #include'd only in the GraphBLAS/CUDA/GB_cuda*.cu source files. +//------------------------------------------------------------------------------ #ifndef GB_CUDA_BUCKETS_H #define GB_CUDA_BUCKETS_H @@ -21,6 +21,7 @@ // dot3: C=A'B, M is sparse or hyper, C is sparse or hyper // 32 kernels A,B: (hyper,sparse,bitmap,full)^2 x (M and C are sparse/hyper) +// FIXME: rename enum values to GB_DOT3_BUCKET* typedef enum { GB_BUCKET_ZOMBIE = 0, // C(i,j) is a zombie (not a bucket) @@ -33,7 +34,7 @@ typedef enum GB_BUCKET_SPDN = 2, // spdn: sparse vector has lots of entries; // use a whole warp for each dot product } -GB_bucket_code ; +GB_bucket_code ; // FIXME: rename GB_dot3_bucket_code // These may use another bucket enum: diff --git a/GraphBLAS/CUDA/GB_cuda_dot3_defn.h b/GraphBLAS/CUDA/Template/GB_cuda_dot3_defn.h similarity index 95% rename from GraphBLAS/CUDA/GB_cuda_dot3_defn.h rename to GraphBLAS/CUDA/Template/GB_cuda_dot3_defn.h index ac6802545d..651ec5c064 100644 --- a/GraphBLAS/CUDA/GB_cuda_dot3_defn.h +++ b/GraphBLAS/CUDA/Template/GB_cuda_dot3_defn.h @@ -1,11 +1,13 @@ //------------------------------------------------------------------------------ -// CUDA/GB_cuda_dot3_defn.h: definitions just for the dot3 method +// GraphBLAS/CUDA/Template/GB_cuda_dot3_defn.h: defns just for dot3 //------------------------------------------------------------------------------ // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// FIXME: rename this to .cuh? It is only #included by GB_cuda_jit* + #pragma once //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_kernel.h b/GraphBLAS/CUDA/Template/GB_cuda_kernel.h similarity index 97% rename from GraphBLAS/CUDA/GB_cuda_kernel.h rename to GraphBLAS/CUDA/Template/GB_cuda_kernel.h index 6ba8d69be3..b4eb500a56 100644 --- a/GraphBLAS/CUDA/GB_cuda_kernel.h +++ b/GraphBLAS/CUDA/Template/GB_cuda_kernel.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// CUDA/GB_cuda_kernel.h: definitions for all GraphBLAS CUDA kernels +// GraphBLAS/CUDA/Template/GB_cuda_kernel.h: definitions for CUDA kernels //------------------------------------------------------------------------------ // SPDX-License-Identifier: Apache-2.0 @@ -9,6 +9,8 @@ // This file is #include'd into all CUDA kernels for GraphBLAS. It provides // a subset of GraphBLAS.h and GB.h, plus other definitions. +// FIXME: rename to .cuh? + #pragma once #define GB_CUDA_KERNEL @@ -75,6 +77,9 @@ 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_Context_opaque *GxB_Context ; +typedef struct GB_Global_opaque *GrB_Global ; +typedef struct GB_Iterator_opaque *GxB_Iterator ; #define GxB_HYPERSPARSE 1 // store matrix in hypersparse form #define GxB_SPARSE 2 // store matrix as sparse form (compressed vector) diff --git a/GraphBLAS/CUDA/go b/GraphBLAS/CUDA/go new file mode 100755 index 0000000000..74b4fa0787 --- /dev/null +++ b/GraphBLAS/CUDA/go @@ -0,0 +1,14 @@ +#!/bin/bash + +# nuke the cached kernels and src +find ~/.SuiteSparse/GrB9.0.1 -mindepth 1 -delete + +# rebuild the JITpackage +( cd ../JITpackage ; make purge ; make ) + +# rebuild GraphBLAS +( cd .. ; make ) + +# run a demo +../build/wathen_demo + diff --git a/GraphBLAS/CUDA/templates/stdbool.h b/GraphBLAS/CUDA/templates/stdbool.h deleted file mode 100644 index abd5a41fc2..0000000000 --- a/GraphBLAS/CUDA/templates/stdbool.h +++ /dev/null @@ -1 +0,0 @@ -// a fake copy of stdbool.h (contents not needed) diff --git a/GraphBLAS/CUDA/test/AxB_dot3_cuda_tests.cpp b/GraphBLAS/CUDA/test/AxB_dot3_cuda_tests.cpp index 758131f202..ca7c5de350 100644 --- a/GraphBLAS/CUDA/test/AxB_dot3_cuda_tests.cpp +++ b/GraphBLAS/CUDA/test/AxB_dot3_cuda_tests.cpp @@ -1,5 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/AxB_dot3_cuda_tests.cpp +//------------------------------------------------------------------------------ + // SPDX-License-Identifier: Apache-2.0 +//------------------------------------------------------------------------------ + // Test AxB_dot3_cuda kernels // Using data generators and test classes, cover // all NBUCKETS cases for the masked GEMM ( C, M, A, B) in GraphBLAS diff --git a/GraphBLAS/CUDA/GB_cuda_type_wrap.hpp b/GraphBLAS/CUDA/test/GB_cuda_type_wrap.hpp similarity index 97% rename from GraphBLAS/CUDA/GB_cuda_type_wrap.hpp rename to GraphBLAS/CUDA/test/GB_cuda_type_wrap.hpp index 22904be260..3acf26553f 100644 --- a/GraphBLAS/CUDA/GB_cuda_type_wrap.hpp +++ b/GraphBLAS/CUDA/test/GB_cuda_type_wrap.hpp @@ -1,3 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/GB_cuda_type_wrap.hpp +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + /* * Copyright (c) 2019,2020 NVIDIA CORPORATION. * diff --git a/GraphBLAS/CUDA/test/GpuTimer.h b/GraphBLAS/CUDA/test/GpuTimer.h index 014d7616de..ed5b52520d 100644 --- a/GraphBLAS/CUDA/test/GpuTimer.h +++ b/GraphBLAS/CUDA/test/GpuTimer.h @@ -1,4 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/GpuTimer.h +//------------------------------------------------------------------------------ + // SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + #ifndef __GPU_TIMER_H__ #define __GPU_TIMER_H__ diff --git a/GraphBLAS/CUDA/test/Makefile b/GraphBLAS/CUDA/test/Makefile index d21f329a0f..412ac47294 100644 --- a/GraphBLAS/CUDA/test/Makefile +++ b/GraphBLAS/CUDA/test/Makefile @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------- -# GraphBLAS/CUDA/Makefile +# GraphBLAS/CUDA/test/Makefile #------------------------------------------------------------------------------- # cuda 10.1+ is assumed @@ -77,12 +77,13 @@ TEMPLATE_DIR ?= ../templates LIB += -ldl -L$(CUDA_LIB_DIR) -L$(CUDA_LIB_DIR)/stubs -lcuda -lcudadevrt -lcudart -lnvrtc +# FIXME: file names in HEADERS are old HEADERS = jitify.hpp dataFactory.hpp jitFactory.hpp jitTestFactory.hpp semiringFactory.hpp \ ../type_name.hpp TEMPLATES := $(wildcard $(TEMPLATE_DIR)/*.cu) -CU_OBJS := ../GB_jit_cache.o ../GB_jit_launcher.o +CU_OBJS := ../GB_cuda_jitify_cache.o ../GB_cuda_jitify_launcher.o CFILES := $(wildcard ../*.c) diff --git a/GraphBLAS/CUDA/test/cuda_tests_template.cpp b/GraphBLAS/CUDA/test/cuda_tests_template.cpp index 66e6413926..340ded031b 100644 --- a/GraphBLAS/CUDA/test/cuda_tests_template.cpp +++ b/GraphBLAS/CUDA/test/cuda_tests_template.cpp @@ -1,5 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/cuda_tests_template.cpp +//------------------------------------------------------------------------------ + // SPDX-License-Identifier: Apache-2.0 +//------------------------------------------------------------------------------ + // Test AxB_dot3_cuda kernels // Using data generators and test classes, cover // all NBUCKETS cases for the masked GEMM ( C, M, A, B) in GraphBLAS diff --git a/GraphBLAS/CUDA/test/dataFactory.hpp b/GraphBLAS/CUDA/test/dataFactory.hpp index af1215175e..5c6263c918 100644 --- a/GraphBLAS/CUDA/test/dataFactory.hpp +++ b/GraphBLAS/CUDA/test/dataFactory.hpp @@ -1,5 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/dataFactory.hpp +//------------------------------------------------------------------------------ + // SPDX-License-Identifier: Apache-2.0 +//------------------------------------------------------------------------------ + #pragma once #include @@ -8,10 +14,9 @@ #include #include "GB.h" -#include "../GB_cuda_type_wrap.hpp" +#include "GB_cuda_type_wrap.hpp" #include "test_utility.hpp" -#include "../GB_cuda_error.h" - +#include "GB_cuda_error.h" // CAUTION: This assumes our indices are small enough to fit into a 32-bit int. inline std::int64_t gen_key(std::int64_t i, std::int64_t j) { diff --git a/GraphBLAS/CUDA/test/jitTestFactory.hpp b/GraphBLAS/CUDA/test/jitTestFactory.hpp index 59344ed234..9e83ae4dd0 100644 --- a/GraphBLAS/CUDA/test/jitTestFactory.hpp +++ b/GraphBLAS/CUDA/test/jitTestFactory.hpp @@ -1,5 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/jitTestFactory.hpp +//------------------------------------------------------------------------------ + // SPDX-License-Identifier: Apache-2.0 +//------------------------------------------------------------------------------ + #pragma once #include diff --git a/GraphBLAS/CUDA/test/problem_spec.hpp b/GraphBLAS/CUDA/test/problem_spec.hpp index fdf55128d0..c1997771ab 100644 --- a/GraphBLAS/CUDA/test/problem_spec.hpp +++ b/GraphBLAS/CUDA/test/problem_spec.hpp @@ -1,3 +1,11 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/problem_spec.hpp +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + #pragma once #include diff --git a/GraphBLAS/CUDA/test/run_tests.cpp b/GraphBLAS/CUDA/test/run_tests.cpp index 3631ce4d3b..2618b9f688 100644 --- a/GraphBLAS/CUDA/test/run_tests.cpp +++ b/GraphBLAS/CUDA/test/run_tests.cpp @@ -1,9 +1,14 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/run_tests.cpp +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + #include -extern "C" { -#include "GraphBLAS.h" -#undef I -} +#include "GraphBLAS_cuda.h" #include "rmm_wrap.h" #include "test_utility.hpp" diff --git a/GraphBLAS/CUDA/test/testGen_cmake.py b/GraphBLAS/CUDA/test/testGen_cmake.py index ade7381ad8..52857f0bd0 100644 --- a/GraphBLAS/CUDA/test/testGen_cmake.py +++ b/GraphBLAS/CUDA/test/testGen_cmake.py @@ -1,4 +1,11 @@ +#------------------------------------------------------------------------------- +# GraphBLAS/CUDA/test/testGen_cmake.py +#------------------------------------------------------------------------------- + # SPDX-License-Identifier: Apache-2.0 + +#------------------------------------------------------------------------------- + # Generate test instances from a large tensor product set of options GB_TYPE_PREFIX = "GrB" diff --git a/GraphBLAS/CUDA/test/test_data.hpp b/GraphBLAS/CUDA/test/test_data.hpp index 1e418260b5..d6cca87d0e 100644 --- a/GraphBLAS/CUDA/test/test_data.hpp +++ b/GraphBLAS/CUDA/test/test_data.hpp @@ -1,3 +1,10 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/test_data.hpp +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ #include #include diff --git a/GraphBLAS/CUDA/test/test_jitify.cpp b/GraphBLAS/CUDA/test/test_jitify.cpp index b3ddbe35f1..30aab0adc2 100644 --- a/GraphBLAS/CUDA/test/test_jitify.cpp +++ b/GraphBLAS/CUDA/test/test_jitify.cpp @@ -1,8 +1,20 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/test_jitify.cpp +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + #include "jitify.hpp" -#include "../GB_jit_launcher.h" +#include "GB_cuda_jitify_launcher.h" int main(int argc, char **argv) { +#if 0 + +BROKEN + std::string named_program = "GB_jit_AxB_phase2"; std::string kern_name = "AxB_phase2"; @@ -21,7 +33,8 @@ int main(int argc, char **argv) { std::string hashable_name = "GB_jit_AxB_phase2"; std::stringstream string_to_be_jitted ; - string_to_be_jitted << hashable_name << std::endl << R"(#include "GB_jit_AxB_dot3_phase2.cuh")"; + string_to_be_jitted << hashable_name << std::endl << + R"(#include "GB_jit_AxB_dot3_phase2.cuh")"; // FIXME: wrong name jit::launcher( hashable_name, string_to_be_jitted.str(), @@ -33,6 +46,6 @@ int main(int argc, char **argv) { .launch( nanobuckets, blockBucket, bucketp, bucket, C->mat, cnz); - +#endif } diff --git a/GraphBLAS/CUDA/test/test_utility.hpp b/GraphBLAS/CUDA/test/test_utility.hpp index d86a558137..3eb6ba942e 100644 --- a/GraphBLAS/CUDA/test/test_utility.hpp +++ b/GraphBLAS/CUDA/test/test_utility.hpp @@ -1,3 +1,10 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/test/test_utility.hpp +//------------------------------------------------------------------------------ + +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ #pragma once diff --git a/GraphBLAS/Config/GB_config.h.in b/GraphBLAS/Config/GB_config.h.in index c72a289d2d..3585ce4c20 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-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Config/GB_prejit.c b/GraphBLAS/Config/GB_prejit.c index 4ac9d69a2d..d2ed98f28e 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-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Config/GB_prejit.c.in b/GraphBLAS/Config/GB_prejit.c.in index aeb735a9ac..0955d97234 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-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Config/GraphBLAS.h.in b/GraphBLAS/Config/GraphBLAS.h.in index c8cec32ae2..9b05ad4dbe 100644 --- a/GraphBLAS/Config/GraphBLAS.h.in +++ b/GraphBLAS/Config/GraphBLAS.h.in @@ -3,7 +3,7 @@ // GraphBLAS.h: definitions for the GraphBLAS package //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,10 +32,10 @@ // Regarding "historical" functions and symbols: when a GxB_* function or // symbol is added to the C API Specification, the new GrB_* name should be -// used instead. The old GxB_* name will be kept for historical reasons, -// documented here and in working order; it might no longer be mentioned in the -// user guide. Historical functions and symbols would only be removed in the -// rare case that they cause a serious conflict with future methods. +// used instead. The old GxB_* name will be kept in working order for +// historical reasons; it might no longer be mentioned in the user guide. +// Historical functions and symbols would only be removed in the rare case that +// they cause a serious conflict with future methods. #ifndef GRAPHBLAS_H #define GRAPHBLAS_H @@ -246,12 +246,12 @@ // The 'about' string the describes this particular implementation of GraphBLAS: #define GxB_IMPLEMENTATION_ABOUT \ -"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved." \ +"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved." \ "\nhttp://suitesparse.com Dept of Computer Sci. & Eng, Texas A&M University.\n" // The GraphBLAS license for this particular implementation of GraphBLAS: #define GxB_IMPLEMENTATION_LICENSE \ -"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved." \ +"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved." \ "\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may\n"\ "not use SuiteSparse:GraphBLAS except in compliance with the License. You\n" \ "may obtain a copy of the License at\n\n" \ @@ -270,10 +270,11 @@ // The 'spec' string describes the GraphBLAS spec: #define GxB_SPEC_ABOUT \ -"GraphBLAS C API, by Aydin Buluc, Timothy Mattson, Scott McMillan,\n" \ -"Jose' Moreira, Carl Yang, and Benjamin Brock. Based on 'GraphBLAS\n" \ -"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" +"GraphBLAS C API, by Benjamin Brock, Aydin Buluc, Raye Kimmerer,\n" \ +"Jim Kitchen, Major Kumar, Timothy Mattson, Scott McMillan, Jose' Moreira,\n" \ +"Erik Welch, and Carl Yang. Based on 'GraphBLAS Mathematics by Jeremy\n" \ +"Kepner. See also 'Graph Algorithms in the Language of Linear Algebra,'\n" \ +"edited by J. Kepner and J. Gilbert, SIAM, 2011.\n" //============================================================================== // GrB_Index: the GraphBLAS integer @@ -330,6 +331,7 @@ typedef enum GrB_DIMENSION_MISMATCH = -6, // matrix dimensions do not match GrB_OUTPUT_NOT_EMPTY = -7, // output matrix already has values GrB_NOT_IMPLEMENTED = -8, // method not implemented + GrB_ALREADY_SET = -9, // field already written to GrB_PANIC = -101, // unknown error GrB_OUT_OF_MEMORY = -102, // out of memory GrB_INSUFFICIENT_SPACE = -103, // output array not large enough @@ -392,7 +394,12 @@ GrB_Info GrB_finalize (void) ; // finish GraphBLAS // GrB_getVersion: GraphBLAS C API version //============================================================================== -// GrB_getVersion provides a runtime access of the C API Version. +// GrB_getVersion provides a runtime access of the C API Version. Can also be +// done with two calls to GrB_Global_get_INT32 with the v2.1 C API: +// +// GrB_get (GrB_GLOBAL, &version, GrB_API_VER_MAJOR) ; +// GrB_get (GrB_GLOBAL, &subversion, GrB_API_VER_MINOR) ; + GrB_Info GrB_getVersion // runtime access to C API version number ( unsigned int *version, // returns GRB_VERSION @@ -405,13 +412,13 @@ GrB_Info GrB_getVersion // runtime access to C API version number // The GrB_Descriptor is used to modify the behavior of GraphBLAS operations. // -// GrB_OUTP: can be GxB_DEFAULT or GrB_REPLACE. If GrB_REPLACE, then C is +// GrB_OUTP: can be GrB_DEFAULT or GrB_REPLACE. If GrB_REPLACE, then C is // cleared after taking part in the accum operation but before the mask. // In other words, C = accum (C,T) is split into Z = accum(C,T) ; // C=0 ; C = Z. // -// GrB_MASK: can be GxB_DEFAULT, GrB_COMP, GrB_STRUCTURE, or set to both -// GrB_COMP and GrB_STRUCTURE. If GxB_DEFAULT, the mask is used +// GrB_MASK: can be GrB_DEFAULT, GrB_COMP, GrB_STRUCTURE, or set to both +// GrB_COMP and GrB_STRUCTURE. If GrB_DEFAULT, the mask is used // normally, where Mask(i,j)=1 means C(i,j) can be modified by C=Z, // and Mask(i,j)=0 means it cannot be modified even if Z(i,j) is has been // computed and differs from C(i,j). If GrB_COMP, this is the same as @@ -419,7 +426,7 @@ GrB_Info GrB_getVersion // runtime access to C API version number // the value of the mask is not considered, just its pattern. The // GrB_COMP and GrB_STRUCTURE settings can be combined. // -// GrB_INP0: can be GxB_DEFAULT or GrB_TRAN. If GxB_DEFAULT, the first input +// GrB_INP0: can be GrB_DEFAULT or GrB_TRAN. If GrB_DEFAULT, the first input // is used as-is. If GrB_TRAN, it is transposed. Only matrices are // transposed this way. Vectors are never transposed via the // GrB_Descriptor. @@ -429,7 +436,7 @@ GrB_Info GrB_getVersion // runtime access to C API version number // GxB_AxB_METHOD: this is a hint to SuiteSparse:GraphBLAS on which algorithm // it should use to compute C=A*B, in GrB_mxm, GrB_mxv, and GrB_vxm. // SuiteSparse:GraphBLAS has four different heuristics, and the default -// method (GxB_DEFAULT) selects between them automatically. The complete +// method (GrB_DEFAULT) selects between them automatically. The complete // rule is in the User Guide. The brief discussion here assumes all // matrices are stored by column. All methods compute the same result, // except that floating-point roundoff may differ when working on @@ -459,7 +466,7 @@ GrB_Info GrB_getVersion // runtime access to C API version number // state, with indices out of order. The sort is left pending. Some // methods can tolerate jumbled matrices on input, so this can be faster. // However, in some cases, it can be faster for GrB_mxm to sort its output -// as it is computed. With GxB_SORT set to GxB_DEFAULT, the sort is left +// as it is computed. With GxB_SORT set to GrB_DEFAULT, the sort is left // pending. With GxB_SORT set to a nonzero value, GrB_mxm typically sorts // the resulting matrix C (but not always; this is just a hint). If // GrB_init is called with GrB_BLOCKING mode, the sort will always be @@ -497,7 +504,8 @@ GrB_Desc_Field ; typedef enum { // for all GrB_Descriptor fields: - GxB_DEFAULT = 0, // default behavior of the method + GrB_DEFAULT = 0, // default behavior of the method + GxB_DEFAULT = 0, // historical; use GrB_DEFAULT instead // for GrB_OUTP only: GrB_REPLACE = 1, // clear the output before assigning new values to it @@ -505,6 +513,7 @@ typedef enum // for GrB_MASK only: GrB_COMP = 2, // use the structural complement of the input GrB_STRUCTURE = 4, // use the only pattern of the mask, not its values + GrB_COMP_STRUCTURE = 6, // shorthand for GrB_COMP + GrB_STRUCTURE // for GrB_INP0 and GrB_INP1 only: GrB_TRAN = 3, // use the transpose of the input @@ -521,7 +530,7 @@ typedef enum GrB_Desc_Value ; // default for GxB pack is to trust the input data -#define GxB_FAST_IMPORT GxB_DEFAULT +#define GxB_FAST_IMPORT ((int) GrB_DEFAULT) typedef struct GB_Descriptor_opaque *GrB_Descriptor ; @@ -530,61 +539,15 @@ GrB_Info GrB_Descriptor_new // create a new descriptor GrB_Descriptor *descriptor // handle of descriptor to create ) ; -GrB_Info GrB_Descriptor_set // set a parameter in a descriptor -( - GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change - GrB_Desc_Value val // value to change it to -) ; - -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 means defaults - GrB_Desc_Field field // parameter to query -) ; - -GrB_Info GxB_Desc_set // set a parameter in a descriptor -( - GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change - ... // value to change it to -) ; - -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 - int32_t value // value to change it to -) ; - -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 - double value // value to change it to -) ; - -GrB_Info GxB_Desc_get // get a parameter from a descriptor -( - GrB_Descriptor desc, // descriptor to query; NULL means defaults - GrB_Desc_Field field, // parameter to query - ... // value of the parameter -) ; - -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 - int32_t *value // return value of the 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 - double *value // return value of the descriptor -) ; +// historical methods; use GrB_set and GrB_get 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_free // free a descriptor ( @@ -731,32 +694,12 @@ GB_GLOBAL GrB_Type // GrB_Type_new: create a new type //------------------------------------------------------------------------------ -// GrB_Type_new is implemented both as a macro and a function. Both are -// user-callable. The default is to use the macro, since this allows the name -// of the type to be saved as a string, for subsequent error reporting by -// GrB_error. - -#undef GrB_Type_new -#undef GrM_Type_new - -GrB_Info GRB (Type_new) // create a new GraphBLAS type +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 ) ; -// user code should not directly use GB_STR or GB_XSTR -// GB_STR: convert the content of x into a string "x" -#define GB_XSTR(x) GB_STR(x) -#define GB_STR(x) #x - -// GrB_Type_new as a user-callable macro, which allows the name of the ctype -// to be added to the new type. The type_defn is unknown. -#define GrB_Type_new(utype, sizeof_ctype) \ - GxB_Type_new(utype, sizeof_ctype, GB_STR(sizeof_ctype), NULL) -#define GrM_Type_new(utype, sizeof_ctype) \ - GxB_Type_new(utype, sizeof_ctype, GB_STR(sizeof_ctype), NULL) - // GxB_Type_new creates a type with a name and definition that are known to // GraphBLAS, as strings. The type_name is any valid string (max length of 128 // characters, including the required null-terminating character) that may @@ -786,22 +729,16 @@ GrB_Info GxB_Type_new // create a new named GraphBLAS type const char *type_defn // typedef for the type (no max length) ) ; -GrB_Info GxB_Type_name // return the name of a GraphBLAS type -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Type type -) ; - -GrB_Info GxB_Type_size // determine the size of the type -( - size_t *size, // the sizeof the type - const GrB_Type type // type to determine the sizeof -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Type_name (char *type_name, const GrB_Type type) ; +GrB_Info GxB_Type_size (size_t *size, const GrB_Type type) ; 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 + GrB_Type *type, // built-in type, or NULL if user-defined. + // The name can be the underlying C type + // ("int8_t") or the GraphBLAS name + // ("GrB_INT8"). const char *type_name // array of size at least GxB_MAX_NAME_LEN ) ; @@ -1006,23 +943,16 @@ GB_GLOBAL GrB_UnaryOp typedef void (*GxB_unary_function) (void *, const void *) ; -// GrB_UnaryOp_new creates a user-defined unary op, with an automatic -// detection of the operator name. -#undef GrB_UnaryOp_new -#undef GrM_UnaryOp_new -GrB_Info GRB (UnaryOp_new) // create a new user-defined unary operator +// GrB_UnaryOp_new creates a user-defined unary op (with no name or defn) +GrB_Info GrB_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 ) ; -#define GrB_UnaryOp_new(op,f,z,x) \ - GxB_UnaryOp_new(op,f,z,x, GB_STR(f), NULL) -#define GrM_UnaryOp_new(op,f,z,x) \ - GxM_UnaryOp_new(op,f,z,x, GB_STR(f), NULL) -// GxB_UnaryOp_new creates a named user-defined unary op. +// GxB_UnaryOp_new creates a named and defined user-defined unary op. GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator ( GrB_UnaryOp *unaryop, // handle for the new unary operator @@ -1033,29 +963,11 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator const char *unop_defn // definition of the user function ) ; -// GxB_UnaryOp_ztype is historical. Use GxB_UnaryOp_ztype_name instead. -GrB_Info GxB_UnaryOp_ztype // return the type of z -( - GrB_Type *ztype, // return type of output z - GrB_UnaryOp unaryop // unary operator -) ; -GrB_Info GxB_UnaryOp_ztype_name // return the type_name of z -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_UnaryOp unaryop // unary operator -) ; - -// GxB_UnaryOp_xtype is historical. Use GxB_UnaryOp_xtype_name instead. -GrB_Info GxB_UnaryOp_xtype // return the type of x -( - GrB_Type *xtype, // return type of input x - GrB_UnaryOp unaryop // unary operator -) ; -GrB_Info GxB_UnaryOp_xtype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_UnaryOp unaryop // unary operator -) ; +// historical; use GrB_get instead: +GrB_Info GxB_UnaryOp_ztype (GrB_Type *ztype, GrB_UnaryOp unaryop) ; +GrB_Info GxB_UnaryOp_ztype_name (char *type_name, const GrB_UnaryOp unaryop) ; +GrB_Info GxB_UnaryOp_xtype (GrB_Type *xtype, GrB_UnaryOp unaryop) ; +GrB_Info GxB_UnaryOp_xtype_name (char *type_name, const GrB_UnaryOp unaryop) ; GrB_Info GrB_UnaryOp_free // free a user-created unary operator ( @@ -1467,11 +1379,8 @@ GB_GLOBAL GrB_BinaryOp GxB_IGNORE_DUP ; typedef void (*GxB_binary_function) (void *, const void *, const void *) ; -// GrB_BinaryOp_new creates a user-defined binary op, with an automatic -// detection of the operator name. -#undef GrB_BinaryOp_new -#undef GrM_BinaryOp_new -GrB_Info GRB (BinaryOp_new) +// GrB_BinaryOp_new creates a user-defined binary op (no name or defn) +GrB_Info GrB_BinaryOp_new ( GrB_BinaryOp *binaryop, // handle for the new binary operator GxB_binary_function function, // pointer to the binary function @@ -1479,12 +1388,8 @@ GrB_Info GRB (BinaryOp_new) GrB_Type xtype, // type of input x GrB_Type ytype // type of input y ) ; -#define GrB_BinaryOp_new(op,f,z,x,y) \ - GxB_BinaryOp_new(op,f,z,x,y, GB_STR(f), NULL) -#define GrM_BinaryOp_new(op,f,z,x,y) \ - GxM_BinaryOp_new(op,f,z,x,y, GB_STR(f), NULL) -// GxB_BinaryOp_new creates a named user-defined binary op. +// GxB_BinaryOp_new creates a named and defined user-defined binary op. GrB_Info GxB_BinaryOp_new ( GrB_BinaryOp *op, // handle for the new binary operator @@ -1496,41 +1401,13 @@ GrB_Info GxB_BinaryOp_new const char *binop_defn // definition of the user function ) ; -// NOTE: GxB_BinaryOp_ztype is historical. Use GxB_BinaryOp_ztype_name instead. -GrB_Info GxB_BinaryOp_ztype // return the type of z -( - GrB_Type *ztype, // return type of output z - GrB_BinaryOp binaryop // binary operator to query -) ; -GrB_Info GxB_BinaryOp_ztype_name // return the type_name of z -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_BinaryOp binaryop // binary operator to query -) ; - -// NOTE: GxB_BinaryOp_xtype is historical. Use GxB_BinaryOp_xtype_name instead. -GrB_Info GxB_BinaryOp_xtype // return the type of x -( - GrB_Type *xtype, // return type of input x - GrB_BinaryOp binaryop // binary operator to query -) ; -GrB_Info GxB_BinaryOp_xtype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_BinaryOp binaryop // binary operator to query -) ; - -// NOTE: GxB_BinaryOp_ytype is historical. Use GxB_BinaryOp_ytype_name instead. -GrB_Info GxB_BinaryOp_ytype // return the type of y -( - GrB_Type *ytype, // return type of input y - GrB_BinaryOp binaryop // binary operator to query -) ; -GrB_Info GxB_BinaryOp_ytype_name // return the type_name of y -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_BinaryOp binaryop // binary operator to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_BinaryOp_ztype (GrB_Type *ztype, GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_ztype_name (char *type_name, const GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_xtype (GrB_Type *xtype, GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_xtype_name (char *type_name, const GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_ytype (GrB_Type *ytype, GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_ytype_name (char *type_name, const GrB_BinaryOp op) ; GrB_Info GrB_BinaryOp_free // free a user-created binary operator ( @@ -1541,8 +1418,7 @@ GrB_Info GrB_BinaryOp_free // free a user-created binary operator // GxB_SelectOp: select operators (DEPRECATED: do not use) //============================================================================== -// GrB_select and GrB_IndexUnaryOp should be used instead of GxB_select. - +// historical; use GrB_select and GrB_IndexUnaryOp instead: typedef struct GB_SelectOp_opaque *GxB_SelectOp ; 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, @@ -1569,12 +1445,9 @@ typedef void (*GxB_index_unary_function) const void *y // input scalar y ) ; -// GrB_IndexUnaryOp_new creates a user-defined unary op, with an automatic -// detection of the operator name. -#undef GrB_IndexUnaryOp_new -#undef GrM_IndexUnaryOp_new +// GrB_IndexUnaryOp_new creates a user-defined unary op (no name or defn) -GrB_Info GRB (IndexUnaryOp_new) // create a new user-defined IndexUnary op +GrB_Info GrB_IndexUnaryOp_new // create a new user-defined IndexUnary op ( GrB_IndexUnaryOp *op, // handle for the new IndexUnary operator GxB_index_unary_function function, // pointer to IndexUnary function @@ -1583,11 +1456,6 @@ GrB_Info GRB (IndexUnaryOp_new) // create a new user-defined IndexUnary op GrB_Type ytype // type of input y (the scalar) ) ; -#define GrB_IndexUnaryOp_new(op,f,z,x,y) \ - GxB_IndexUnaryOp_new(op,f,z,x,y, GB_STR(f), NULL) -#define GrM_IndexUnaryOp_new(op,f,z,x,y) \ - GxM_IndexUnaryOp_new(op,f,z,x,y, GB_STR(f), NULL) - GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp ( GrB_IndexUnaryOp *op, // handle for the new IndexUnary operator @@ -1599,26 +1467,10 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp const char *idxop_defn // definition of the user function ) ; -GrB_Info GxB_IndexUnaryOp_ztype_name // return the type_name of z -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_IndexUnaryOp op // IndexUnary operator -) ; - -// For TRIL, TRIU, DIAG, OFFDIAG, COLLE, COLGT, ROWLE, and ROWGT, -// the xtype_name is an empty string (""), since these functions do not depend -// on the type of the matrix input. -GrB_Info GxB_IndexUnaryOp_xtype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_IndexUnaryOp op // select operator -) ; - -GrB_Info GxB_IndexUnaryOp_ytype_name // return the type_name of the scalary y -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_IndexUnaryOp op // select operator -) ; +// historical; use GrB_get instead: +GrB_Info GxB_IndexUnaryOp_ztype_name (char *, const GrB_IndexUnaryOp op) ; +GrB_Info GxB_IndexUnaryOp_xtype_name (char *, const GrB_IndexUnaryOp op) ; +GrB_Info GxB_IndexUnaryOp_ytype_name (char *, const GrB_IndexUnaryOp op) ; GrB_Info GrB_IndexUnaryOp_free // free a user-created IndexUnaryOp ( @@ -1820,14 +1672,12 @@ GrB_Info GrB_Monoid_new_UDT // create a monoid with a user-defined type // Type-generic method for creating a new monoid: /* - 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 ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -1960,7 +1810,6 @@ GrB_Info GxB_Monoid_terminal_new_UDT // create a monoid with a user type // Type-generic method for creating a new monoid with a terminal value: /* - GrB_Info GxB_Monoid_terminal_new // create a monoid ( GrB_Monoid *monoid, // handle of monoid to create @@ -1968,7 +1817,6 @@ GrB_Info GxB_Monoid_terminal_new // create a monoid identity, // identity value of the monoid terminal // terminal value of the monoid ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -1981,25 +1829,10 @@ GrB_Info GxB_Monoid_terminal_new // create a monoid (monoid, op, identity, terminal) #endif -GrB_Info GxB_Monoid_operator // return the monoid operator -( - GrB_BinaryOp *op, // returns the binary op of the monoid - GrB_Monoid monoid // monoid to query -) ; - -GrB_Info GxB_Monoid_identity // return the monoid identity -( - void *identity, // returns the identity of the monoid - GrB_Monoid monoid // monoid to query -) ; - -GrB_Info GxB_Monoid_terminal // return the monoid terminal -( - bool *has_terminal, // true if the monoid has a terminal value - void *terminal, // returns the terminal of the monoid, - // unmodified if has_terminal is false - GrB_Monoid monoid // monoid to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Monoid_operator (GrB_BinaryOp *op, GrB_Monoid monoid) ; +GrB_Info GxB_Monoid_identity (void *identity, GrB_Monoid monoid) ; +GrB_Info GxB_Monoid_terminal (bool *, void *terminal, GrB_Monoid monoid) ; GrB_Info GrB_Monoid_free // free a user-created monoid ( @@ -2019,17 +1852,9 @@ GrB_Info GrB_Semiring_new // create a semiring GrB_BinaryOp multiply // multiply operator of the semiring ) ; -GrB_Info GxB_Semiring_add // return the add monoid of a semiring -( - GrB_Monoid *add, // returns add monoid of the semiring - GrB_Semiring semiring // semiring to query -) ; - -GrB_Info GxB_Semiring_multiply // return multiply operator of a semiring -( - GrB_BinaryOp *multiply, // returns multiply operator of the semiring - GrB_Semiring semiring // semiring to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Semiring_add (GrB_Monoid *add, GrB_Semiring semiring) ; +GrB_Info GxB_Semiring_multiply (GrB_BinaryOp *multiply, GrB_Semiring semiring) ; GrB_Info GrB_Semiring_free // free a user-created semiring ( @@ -2040,9 +1865,6 @@ GrB_Info GrB_Semiring_free // free a user-created semiring // GrB_Scalar: a GraphBLAS scalar //============================================================================== -// GxB_Scalar has become GrB_Scalar. The older name GxB_Scalar is kept as -// historical, but GrB_Scalar should be used instead. - typedef struct GB_Scalar_opaque *GxB_Scalar ; // historical: use GrB_Scalar typedef struct GB_Scalar_opaque *GrB_Scalar ; // use this instead @@ -2072,18 +1894,9 @@ GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar const GrB_Scalar s // GrB_Scalar to query ) ; -// NOTE: GxB_Scalar_type is historical. Use GxB_Scalar_type_name instead. -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 -) ; -GrB_Info GxB_Scalar_type_name // return the name of the type of a scalar -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Scalar s // GrB_Scalar to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Scalar_type (GrB_Type *type, const GrB_Scalar s) ; +GrB_Info GxB_Scalar_type_name (char *type_name, const GrB_Scalar s) ; GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar ( @@ -2212,13 +2025,11 @@ GrB_Info GxB_Scalar_setElement_UDT (GrB_Scalar s, void *x) ; // user-defined type. /* - GrB_Info GrB_Scalar_setElement // s = x ( GrB_Scalar s, // GrB_Scalar to modify x // user scalar to assign to s ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -2230,6 +2041,7 @@ GrB_Info GrB_Scalar_setElement // s = x ) \ (s, x) +// historical; use GrB_Scalar_setElement instead: #define GxB_Scalar_setElement(s,x) GrB_Scalar_setElement (s, x) #endif @@ -2360,6 +2172,7 @@ GrB_Info GrB_Scalar_extractElement // x = s ) \ (x, s) +// historical; use GrB_Scalar_extractElement instead: #define GxB_Scalar_extractElement(x,s) GrB_Scalar_extractElement (x, s) #endif @@ -2403,18 +2216,9 @@ GrB_Info GrB_Vector_nvals // get the number of entries in a vector const GrB_Vector v // vector to query ) ; -// NOTE: GxB_Vector_type is historical. Use GxB_Vector_type_name instead. -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 -) ; -GrB_Info GxB_Vector_type_name // return the name of the type of a vector -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Vector v // vector to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Vector_type (GrB_Type *type, const GrB_Vector v) ; +GrB_Info GxB_Vector_type_name (char *type_name, const GrB_Vector v) ; GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector ( @@ -2578,7 +2382,6 @@ GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples // for a user-defined type. /* - GrB_Info GrB_Vector_build // build a vector from (I,X) tuples ( GrB_Vector w, // vector to build @@ -2587,7 +2390,6 @@ GrB_Info GrB_Vector_build // build a vector from (I,X) tuples GrB_Index nvals, // number of tuples const GrB_BinaryOp dup // binary function to assemble duplicates ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -2716,14 +2518,12 @@ GrB_Info GrB_Vector_setElement_Scalar // w(i) = x // user-defined type. /* - GrB_Info GrB_Vector_setElement // w(i) = x ( GrB_Vector w, // vector to modify x, // scalar to assign to w(i) GrB_Index i // row index ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -2853,14 +2653,12 @@ GrB_Info GrB_Vector_extractElement_Scalar // x = v(i) // for a user-defined type. /* - GrB_Info GrB_Vector_extractElement // x = v(i) ( *x, // scalar extracted const GrB_Vector v, // vector to extract an entry from GrB_Index i // row index ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -3021,7 +2819,6 @@ GrB_Info GrB_Vector_extractTuples_UDT // [I,~,X] = find (v) // for a user-defined type. /* - GrB_Info GrB_Vector_extractTuples // [I,~,X] = find (v) ( GrB_Index *Ilist, // array for returning row indices of tuples @@ -3029,11 +2826,10 @@ GrB_Info GrB_Vector_extractTuples // [I,~,X] = find (v) GrB_Index *nvals, // I, X size on input; # tuples on output const GrB_Vector v // vector to extract tuples from ) ; - */ #if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_extractTuples(Ilist,X,nvals,v) \ +#define GrB_Vector_extractTuples(Ilist,X,nvals,v) \ _Generic \ ( \ (X), \ @@ -3088,18 +2884,9 @@ GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix const GrB_Matrix A // matrix to query ) ; -// NOTE: GxB_Matrix_type is historical. Use GxB_Matrix_type_name instead. -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 -) ; -GrB_Info GxB_Matrix_type_name // return the name of the type of a matrix -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Matrix A // matrix to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Matrix_type (GrB_Type *type, const GrB_Matrix A) ; +GrB_Info GxB_Matrix_type_name (char *type_name, const GrB_Matrix A) ; GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix ( @@ -3128,7 +2915,7 @@ GrB_Info GrB_Matrix_free // free a matrix GrB_Info GrB_Matrix_build_BOOL // 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 *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 @@ -3138,7 +2925,7 @@ GrB_Info GrB_Matrix_build_BOOL // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_INT8 // 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 *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 @@ -3148,7 +2935,7 @@ GrB_Info GrB_Matrix_build_INT8 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_UINT8 // 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 *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 @@ -3158,7 +2945,7 @@ GrB_Info GrB_Matrix_build_UINT8 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_INT16 // 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 *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 @@ -3168,7 +2955,7 @@ GrB_Info GrB_Matrix_build_INT16 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_UINT16 // 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 *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 @@ -3178,7 +2965,7 @@ GrB_Info GrB_Matrix_build_UINT16 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_INT32 // 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 *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 @@ -3188,7 +2975,7 @@ GrB_Info GrB_Matrix_build_INT32 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_UINT32 // 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 *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 @@ -3198,7 +2985,7 @@ GrB_Info GrB_Matrix_build_UINT32 // build a matrix from (I,J,X) tuples 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 *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 @@ -3208,7 +2995,7 @@ GrB_Info GrB_Matrix_build_INT64 // build a matrix from (I,J,X) tuples 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 *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 @@ -3218,7 +3005,7 @@ GrB_Info GrB_Matrix_build_UINT64 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_FP32 // 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 *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 @@ -3228,7 +3015,7 @@ GrB_Info GrB_Matrix_build_FP32 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_FP64 // 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 *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 @@ -3238,7 +3025,7 @@ GrB_Info GrB_Matrix_build_FP64 // build a matrix from (I,J,X) tuples 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 *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 @@ -3248,7 +3035,7 @@ GrB_Info GxB_Matrix_build_FC32 // build a matrix from (I,J,X) tuples GrB_Info GxB_Matrix_build_FC64 // 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 *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 @@ -3258,7 +3045,7 @@ GrB_Info GxB_Matrix_build_FC64 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_UDT // 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 *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 @@ -3268,7 +3055,7 @@ GrB_Info GrB_Matrix_build_UDT // build a matrix from (I,J,X) tuples 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 *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 @@ -3278,21 +3065,19 @@ GrB_Info GxB_Matrix_build_Scalar // build a matrix from (I,J,scalar) tuples // for a user-defined type. /* - 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 *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 ) ; - */ #if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_build(C,Ilist,J,X,nvals,dup) \ +#define GrB_Matrix_build(C,Ilist,J,X,nvals,dup) \ _Generic \ ( \ (X), \ @@ -3432,7 +3217,6 @@ GrB_Info GrB_Matrix_setElement_Scalar // C (i,j) = x // user-defined type. /* - GrB_Info GrB_Matrix_setElement // C (i,j) = x ( GrB_Matrix C, // matrix to modify @@ -3440,7 +3224,6 @@ GrB_Info GrB_Matrix_setElement // C (i,j) = x GrB_Index i, // row index GrB_Index j // column index ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -3585,7 +3368,6 @@ GrB_Info GrB_Matrix_extractElement_Scalar // x = A(i,j) // for a user-defined type. /* - GrB_Info GrB_Matrix_extractElement // x = A(i,j) ( *x, // extracted scalar @@ -3593,7 +3375,6 @@ GrB_Info GrB_Matrix_extractElement // x = A(i,j) GrB_Index i, // row index GrB_Index j // column index ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -3770,7 +3551,6 @@ GrB_Info GrB_Matrix_extractTuples_UDT // [I,J,X] = find (A) // 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 @@ -3779,7 +3559,6 @@ GrB_Info GrB_Matrix_extractTuples // [I,J,X] = find (A) 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 @@ -3819,7 +3598,7 @@ GrB_Info GrB_Matrix_extractTuples // [I,J,X] = find (A) // 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 GxB_Matrix_Option_set (format by row +// 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. @@ -3877,7 +3656,7 @@ GrB_Info GrB_Matrix_diag // build a diagonal matrix from a vector // 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 GxB_Matrix_Option_set (format by row or by column, bitmap switch, hyper +// 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 @@ -3902,7 +3681,7 @@ GrB_Info GxB_Matrix_diag // construct a diagonal matrix from a vector // 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 -// GxB_Vector_Option_set (bitmap switch and sparsity control) are unchanged. +// GrB_set (bitmap switch and sparsity control) are unchanged. GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector ( @@ -3917,60 +3696,58 @@ GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector //============================================================================== // The following options modify how SuiteSparse:GraphBLAS stores and operates -// on its matrices. The GxB_*Option* methods allow the user to suggest how the +// 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. -// GxB_Matrix_Option_set: sets an option for a specific matrix -// GxB_Matrix_Option_get: queries the current option of a specific matrix -// GxB_Vector_Option_set: sets an option for a specific vector -// GxB_Vector_Option_get: queries the current option of a specific vector -// GxB_Global_Option_set: sets an option for all future matrices -// GxB_Global_Option_get: queries current option for all future matrices - typedef enum // for global options or matrix options { //------------------------------------------------------------ - // for GxB_Matrix_Option_get/set and GxB_Global_Option_get/set: + // 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) - GxB_FORMAT = 7002, // CSR/CSC format: GxB_BY_ROW or GxB_BY_COL + GxB_FORMAT = 7002, // historical; use GrB_STORAGE_ORIENTATION_HINT //------------------------------------------------------------ - // for GxB_Global_Option_get only: + // GrB_get for GrB_GLOBAL: //------------------------------------------------------------ - GxB_MODE = 7003, // mode passed to GrB_init - GxB_LIBRARY_NAME = 7004, // name of the library (char *) - GxB_LIBRARY_VERSION = 7005, // library version (3 int's) + GxB_MODE = 7003, // historical; use GrB_BLOCKING_MODE + GxB_LIBRARY_NAME = 7004, // historical; use GrB_NAME + GxB_LIBRARY_VERSION = 7005, // historical; use GrB_LIBRARY_VER_* 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_VERSION = 7012, // API version (3 int's) + GxB_API_VERSION = 7012, // historical; use GrB_API_VER_* 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 //------------------------------------------------------------ - // for GxB_Global_Option_get/set only: + // 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_GLOBAL_GPU_ID = GxB_GPU_ID, // which GPU to use (DRAFT) - GxB_BURBLE = 7019, // diagnostic output (bool *) + GxB_BURBLE = 7019, // diagnostic output GxB_PRINTF = 7020, // printf function diagnostic output GxB_FLUSH = 7021, // flush function diagnostic output GxB_MEMORY_POOL = 7022, // no longer used @@ -3988,27 +3765,18 @@ typedef enum // for global options or matrix options GxB_JIT_ERROR_LOG = 7033, // CPU JIT: error log file //------------------------------------------------------------ - // for GxB_Matrix_Option_get only: + // 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 //------------------------------------------------------------ - // for GxB_Matrix_Option_get/set only: + // GrB_get/GrB_set for GrB_Matrix: //------------------------------------------------------------ GxB_SPARSITY_CONTROL = 7036, // sparsity control: 0 to 15; see below - //------------------------------------------------------------ - // memory functions (GxB_Global_Option_get only): - //------------------------------------------------------------ - - GxB_MALLOC_FUNCTION = 7037, - GxB_CALLOC_FUNCTION = 7038, - GxB_REALLOC_FUNCTION = 7039, - GxB_FREE_FUNCTION = 7040, - } GxB_Option_Field ; // for GxB_JIT_C_CONTROL: @@ -4022,7 +3790,7 @@ typedef enum } GxB_JIT_Control ; -// GxB_FORMAT can be by row or by column: +// GxB_FORMAT is historical, but it can be by row or by column: typedef enum { GxB_BY_ROW = 0, // CSR: compressed sparse row format @@ -4055,7 +3823,7 @@ GB_GLOBAL const double GxB_HYPER_DEFAULT ; // the default sparsity control is any format: #define GxB_AUTO_SPARSITY GxB_ANY_SPARSITY -// GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, scontrol) provides hints +// GrB_set (A, scontrol, GxB_SPARSITY_CONTROL) provides hints // about which data structure GraphBLAS should use for the matrix A: // // GxB_AUTO_SPARSITY: GraphBLAS selects automatically. @@ -4078,11 +3846,11 @@ GB_GLOBAL const double GxB_HYPER_DEFAULT ; // formats can be bitwise negated. For example, to allow for any format // except full, use ~GxB_FULL. // -// GxB_Matrix_Option_get (A, GxB_SPARSITY_STATUS, &sparsity) returns the +// GrB_get (A, &sparsity, GxB_SPARSITY_STATUS) returns the // current data structure currently used for the matrix A (either hypersparse, // sparse, bitmap, or full). // -// GxB_Matrix_Option_get (A, GxB_SPARSITY_CONTROL, &scontrol) returns the hint +// GrB_get (A, &scontrol, GxB_SPARSITY_CONTROL) returns the hint // for how A should be stored (hypersparse, sparse, bitmap, or full, or any // combination). @@ -4113,183 +3881,6 @@ GB_GLOBAL const double GxB_HYPER_DEFAULT ; GB_GLOBAL const double GxB_ALWAYS_HYPER, GxB_NEVER_HYPER ; -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 - ... // value to change it to -) ; - -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 - int32_t value // value to change it to -) ; - -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 - double value // value to change it to -) ; - -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 - ... // return value of the matrix option -) ; - -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 - int32_t *value // return value of the matrix option -) ; - -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 - double *value // return value of the matrix option -) ; - -GrB_Info GxB_Vector_Option_set // set an option in a vector -( - GrB_Vector A, // vector to modify - GxB_Option_Field field, // option to change - ... // value to change it to -) ; - -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 - int32_t value // value to change it to -) ; - -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 - double value // value to change it to -) ; - -GrB_Info GxB_Vector_Option_get // gets the current option of a vector -( - GrB_Vector A, // vector to query - GxB_Option_Field field, // option to query - ... // return value of the vector option -) ; - -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 - int32_t *value // return value of the vector option -) ; - -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 - double *value // return value of the vector option -) ; - -// GxB_Global_Option_set controls the global defaults used when a new matrix is -// created. GrB_init defines the following initial settings: -// -// GxB_Global_Option_set (GxB_HYPER_SWITCH, GxB_HYPER_DEFAULT) ; -// GxB_Global_Option_set (GxB_BITMAP_SWITCH, NULL) ; -// GxB_Global_Option_set (GxB_FORMAT, GxB_FORMAT_DEFAULT) ; -// -// The compile-time constants GxB_HYPER_DEFAULT and GxB_FORMAT_DEFAULT are -// equal to 0.0625 and GxB_BY_ROW, by default. That is, by default, all new -// matrices are held by row in CSR format. If a matrix has fewer than n/16 -// columns, it can be converted to hypersparse structure. If it has more than -// n/8 columns, it can be converted to a sparse structure. Modifying these -// global settings via GxB_Global_Option_set has no effect on matrices already -// created. - -GrB_Info GxB_Global_Option_set // set a global default option -( - GxB_Option_Field field, // option to change - ... // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_INT32 // set a global default option -( - GxB_Option_Field field, // option to change - int32_t value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_FP64 // set a global default option -( - GxB_Option_Field field, // option to change - double value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_FP64_ARRAY // set a global default option -( - GxB_Option_Field field, // option to change - double *value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_INT64_ARRAY // set a global default option -( - GxB_Option_Field field, // option to change - int64_t *value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_CHAR // set a global default option -( - GxB_Option_Field field, // option to change - const char *value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_FUNCTION // set a global default option -( - GxB_Option_Field field, // option to change - void *value // value to change it to -) ; - -GrB_Info GxB_Global_Option_get // gets the current global default option -( - GxB_Option_Field field, // option to query - ... // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_INT32 // gets the current global option -( - GxB_Option_Field field, // option to query - int32_t *value // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_FP64 // gets the current global option -( - GxB_Option_Field field, // option to query - double *value // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_INT64 // gets the current global option -( - GxB_Option_Field field, // option to query - int64_t *value // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_CHAR // gets the current global option -( - GxB_Option_Field field, // option to query - const char **value // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_FUNCTION // gets the current global option -( - GxB_Option_Field field, // option to query - void **value // return value of the global option -) ; - //============================================================================== // GxB_Context: for managing computational resources //============================================================================== @@ -4322,48 +3913,6 @@ GrB_Info GxB_Context_free // free a Context GxB_Context *Context // handle of Context to free ) ; -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 - int32_t value // value to change it to -) ; - -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 - double value // value to change it to -) ; - -GrB_Info GxB_Context_set // set a parameter in a Context -( - GxB_Context Context, // Context to modify - GxB_Context_Field field, // parameter to change - ... // value to change it to -) ; - -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 - int32_t *value // return value from the 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 - double *value // return value from the 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 - ... // return value of the descriptor -) ; - GrB_Info GxB_Context_engage // engage a Context ( GxB_Context Context // Context to engage @@ -4375,152 +3924,41 @@ GrB_Info GxB_Context_disengage // disengage a Context ) ; //============================================================================== -// GxB_set and GxB_get +// GxB_set and GxB_get: historical; use GrB_set and GrB_get instead //============================================================================== -// The simplest way to set/get a value of a GrB_Descriptor is with -// the generic GxB_set and GxB_get functions: - -// GxB_set (desc, field, value) ; -// GxB_get (desc, field, &value) ; - -// GxB_set and GxB_get are generic methods that and set or query the options in -// a GrB_Matrix, a GrB_Descriptor, or in the global options. They can be used -// with the following syntax. - -// To set/get the global options: -// -// GxB_set (GxB_HYPER_SWITCH, double h) ; -// GxB_set (GxB_HYPER_SWITCH, GxB_ALWAYS_HYPER) ; -// GxB_set (GxB_HYPER_SWITCH, GxB_NEVER_HYPER) ; -// GxB_get (GxB_HYPER_SWITCH, double *h) ; -// -// double b [GxB_NBITMAP_SWITCH] ; -// GxB_set (GxB_BITMAP_SWITCH, b) ; -// GxB_set (GxB_BITMAP_SWITCH, NULL) ; // set defaults -// GxB_get (GxB_BITMAP_SWITCH, b) ; -// -// GxB_set (GxB_FORMAT, GxB_BY_ROW) ; -// GxB_set (GxB_FORMAT, GxB_BY_COL) ; -// GxB_get (GxB_FORMAT, GxB_Format_Value *s) ; -// -// GxB_set (GxB_NTHREADS, nthreads_max) ; -// GxB_get (GxB_NTHREADS, int *nthreads_max) ; -// -// GxB_set (GxB_CHUNK, double chunk) ; -// GxB_get (GxB_CHUNK, double *chunk) ; -// -// GxB_set (GxB_BURBLE, bool burble) ; -// GxB_get (GxB_BURBLE, bool *burble) ; -// -// GxB_set (GxB_PRINTF, void *printf_function) ; -// GxB_get (GxB_PRINTF, void **printf_function) ; -// -// GxB_set (GxB_FLUSH, void *flush_function) ; -// GxB_get (GxB_FLUSH, void **flush_function) ; - -// GxB_set (GxB_JIT_C_COMPILER_NAME, const char *compiler) ; -// GxB_get (GxB_JIT_C_COMPILER_NAME, const char **compiler) ; -// GxB_set (GxB_JIT_C_COMPILER_FLAGS, const char *flags) ; -// GxB_get (GxB_JIT_C_COMPILER_FLAGS, const char **flags) ; -// GxB_set (GxB_JIT_C_LINKER_FLAGS, const char *flags) ; -// GxB_get (GxB_JIT_C_LINKER_FLAGS, const char **flags) ; -// GxB_set (GxB_JIT_CACHE_PATH, const char *cache_path) ; -// GxB_get (GxB_JIT_CACHE_PATH, const char **cache_path) ; -// GxB_set (GxB_JIT_C_CONTROL, int control) ; -// GxB_get (GxB_JIT_C_CONTROL, int *control) ; - -// To set/get the GxB_CONTEXT_WORLD options: These have the same effect as -// the global set/get for NTHREADS and CHUNK, listed above. -// -// GxB_set (GxB_CONTEXT_WORLD, GxB_NTHREADS, nthreads_max) ; -// GxB_get (GxB_CONTEXT_WORLD, GxB_NTHREADS, int *nthreads_max) ; -// -// GxB_set (GxB_CONTEXT_WORLD, GxB_CHUNK, double chunk) ; -// GxB_get (GxB_CONTEXT_WORLD, GxB_CHUNK, double *chunk) ; - -// To set/get a Context option: -// -// GxB_set (GxB_Context Context, GxB_NTHREADS, nthreads_max) ; -// GxB_get (GxB_Context Context, GxB_NTHREADS, int *nthreads_max) ; -// -// GxB_set (GxB_Context Context, GxB_CHUNK, double chunk) ; -// GxB_get (GxB_Context Context, GxB_CHUNK, double *chunk) ; - -// To get global options that can be queried but not modified: -// -// GxB_get (GxB_MODE, GrB_Mode *mode) ; - -// To set/get a matrix option: -// -// GxB_set (GrB_Matrix A, GxB_HYPER_SWITCH, double h) ; -// GxB_set (GrB_Matrix A, GxB_HYPER_SWITCH, GxB_ALWAYS_HYPER) ; -// GxB_set (GrB_Matrix A, GxB_HYPER_SWITCH, GxB_NEVER_HYPER) ; -// GxB_get (GrB_Matrix A, GxB_HYPER_SWITCH, double *h) ; -// -// GxB_set (GrB_Matrix A, GxB_BITMAP_SWITCH, double b) ; -// GxB_get (GrB_Matrix A, GxB_BITMAP_SWITCH, double *b) ; -// -// GxB_set (GrB_Matrix A, GxB_FORMAT, GxB_BY_ROW) ; -// GxB_set (GrB_Matrix A, GxB_FORMAT, GxB_BY_COL) ; -// GxB_get (GrB_Matrix A, GxB_FORMAT, GxB_Format_Value *s) ; -// -// GxB_set (GrB_Matrix A, GxB_SPARSITY_CONTROL, GxB_AUTO_SPARSITY) ; -// GxB_set (GrB_Matrix A, GxB_SPARSITY_CONTROL, scontrol) ; -// GxB_get (GrB_Matrix A, GxB_SPARSITY_CONTROL, int *scontrol) ; -// -// GxB_get (GrB_Matrix A, GxB_SPARSITY_STATUS, int *sparsity) ; - -// To set/get a vector option or status: -// -// GxB_set (GrB_Vector v, GxB_BITMAP_SWITCH, double b) ; -// GxB_get (GrB_Vector v, GxB_BITMAP_SWITCH, double *b) ; -// -// GxB_set (GrB_Vector v, GxB_FORMAT, GxB_BY_ROW) ; -// GxB_set (GrB_Vector v, GxB_FORMAT, GxB_BY_COL) ; -// GxB_get (GrB_Vector v, GxB_FORMAT, GxB_Format_Value *s) ; -// -// GxB_set (GrB_Vector v, GxB_SPARSITY_CONTROL, GxB_AUTO_SPARSITY) ; -// GxB_set (GrB_Vector v, GxB_SPARSITY_CONTROL, scontrol) ; -// GxB_get (GrB_Vector v, GxB_SPARSITY_CONTROL, int *scontrol) ; -// -// GxB_get (GrB_Vector v, GxB_SPARSITY_STATUS, int *sparsity) ; - -// To set/get a descriptor field: -// -// GxB_set (GrB_Descriptor d, GrB_OUTP, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GrB_OUTP, GrB_REPLACE) ; -// GxB_get (GrB_Descriptor d, GrB_OUTP, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GrB_MASK, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GrB_MASK, GrB_COMP) ; -// GxB_set (GrB_Descriptor d, GrB_MASK, GrB_STRUCTURE) ; -// GxB_set (GrB_Descriptor d, GrB_MASK, GrB_COMP + GrB_STRUCTURE) ; -// GxB_get (GrB_Descriptor d, GrB_MASK, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GrB_INP0, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GrB_INP0, GrB_TRAN) ; -// GxB_get (GrB_Descriptor d, GrB_INP0, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GrB_INP1, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GrB_INP1, GrB_TRAN) ; -// GxB_get (GrB_Descriptor d, GrB_INP1, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_GUSTAVSON) ; -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_HASH) ; -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_SAXPY) ; -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_DOT) ; -// GxB_get (GrB_Descriptor d, GrB_AxB_METHOD, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GxB_SORT, int sort) ; -// GxB_get (GrB_Descriptor d, GxB_SORT, int *sort) ; -// -// GxB_set (GrB_Descriptor d, GxB_COMPRESSION, int method) ; -// GxB_get (GrB_Descriptor d, GxB_COMPRESSION, int *method) ; -// -// GxB_set (GrB_Descriptor d, GxB_IMPORT, int method) ; -// GxB_get (GrB_Descriptor d, GxB_IMPORT, int *method) ; +// historical: use GrB_set and GrB_get instead of these methods: +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, ...) ; #if GxB_STDC_VERSION >= 201112L #define GxB_set(arg1,...) \ @@ -4550,6 +3988,518 @@ GrB_Info GxB_Context_disengage // disengage a Context (arg1, __VA_ARGS__) #endif +//============================================================================== +// 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, and GrB_IndexUnaryOp: + 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_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 ; + +//------------------------------------------------------------------------------ +// 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 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 \ + ) , \ + 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__) + +//------------------------------------------------------------------------------ +// 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 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 \ + ) , \ + 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 + +#endif + //============================================================================== // GrB_free: free any GraphBLAS object //============================================================================== @@ -5023,7 +4973,7 @@ GrB_Info GrB_Vector_extract // w = accum (w, u(I)) 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 + const GrB_Index *Ilist, // row indices GrB_Index ni, // number of row indices const GrB_Descriptor desc // descriptor for w and mask ) ; @@ -5034,7 +4984,7 @@ GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) 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 + 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 @@ -5047,7 +4997,7 @@ GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) 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 + 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 @@ -9237,6 +9187,11 @@ GrB_Info GxB_Context_fprint // print and check a GxB_Context FILE *f // file for output ) ; +// user code should not directly use GB_STR or GB_XSTR +// GB_STR: convert the content of x into a string "x" +#define GB_XSTR(x) GB_STR(x) +#define GB_STR(x) #x + #if GxB_STDC_VERSION >= 201112L #define GxB_fprint(object,pr,f) \ _Generic \ @@ -10791,7 +10746,7 @@ GrB_Info GrB_Matrix_exportHint // suggest the best export format fread (blob, sizeof (uint8_t), blob_size, f) ; fclose (f) ; char type_name [GxB_MAX_NAME_LEN] ; - GxB_deserialize_type_name (type_name, blob, blob_size) ; + GrB_get (blob, type_name, GxB_JIT_C_NAME, blob_size) ; printf ("blob type is: %s\n", type_name) ; GrB_Type user_type = NULL ; if (strncmp (type_name, "myquaternion", GxB_MAX_NAME_LEN) == 0) @@ -10946,23 +10901,8 @@ GrB_Info GxB_Vector_deserialize // deserialize blob into a GrB_Vector const GrB_Descriptor desc // to control # of threads used ) ; -// GxB_deserialize_type_name extracts the type_name of the GrB_Type of the -// GrB_Matrix or GrB_Vector held in a serialized blob. On input, type_name -// must point to a user-owned char array of size at least GxB_MAX_NAME_LEN (it -// must not point into the blob itself). On output, type_name will contain a -// null-terminated string with the corresponding C type name. If the blob -// holds a matrix of a built-in type, the name is returned as "bool" for -// GrB_BOOL, "uint8_t" for GrB_UINT8, "float complex" for GxB_FC32, etc. -// See GxB_Type_name to convert this name into a GrB_Type. -GrB_Info GxB_deserialize_type_name // return the type name of a blob -( - // output: - char *type_name, // name of the type (char array of size at least - // 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 -) ; +// historical; use GrB_get with GxB_JIT_C_NAME instead. +GrB_Info GxB_deserialize_type_name (char *, const void *, GrB_Index) ; //============================================================================== // GxB_Vector_sort and GxB_Matrix_sort: sort a matrix or vector diff --git a/GraphBLAS/Config/GraphBLAS.pc.in b/GraphBLAS/Config/GraphBLAS.pc.in index 1eafb5dd97..db39c4c671 100644 --- a/GraphBLAS/Config/GraphBLAS.pc.in +++ b/GraphBLAS/Config/GraphBLAS.pc.in @@ -1,4 +1,4 @@ -# GraphBLAS, Copyright (c) 2017-2023, Timothy A. Davis. +# GraphBLAS, Copyright (c) 2017-2024, Timothy A. Davis. # All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 diff --git a/GraphBLAS/Config/GraphBLASConfig.cmake.in b/GraphBLAS/Config/GraphBLASConfig.cmake.in index 1ce4385c84..a806fc3217 100644 --- a/GraphBLAS/Config/GraphBLASConfig.cmake.in +++ b/GraphBLAS/Config/GraphBLASConfig.cmake.in @@ -4,7 +4,8 @@ # The following copyright and license applies to just this file only, not to # the library itself: -# GraphBLASConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# GraphBLASConfig.cmake, Copyright (c) 2024, Timothy A. Davis. All Rights +# Reserved. # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- @@ -62,7 +63,7 @@ endif ( ) # Look for OpenMP if ( @GRAPHBLAS_HAS_OPENMP@ AND NOT OpenMP_C_FOUND ) - find_dependency ( OpenMP ) + find_dependency ( OpenMP COMPONENTS C ) if ( NOT OpenMP_C_FOUND ) set ( _dependencies_found OFF ) endif ( ) @@ -110,6 +111,7 @@ set ( _var_prefix "GRAPHBLAS" ) if ( NOT @BUILD_SHARED_LIBS@ AND NOT TARGET ${_target_shared} ) # make sure there is always an import target without suffix ) add_library ( ${_target_shared} ALIAS ${_target_static} ) + set ( _shared_is_aliased ON ) endif ( ) get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) @@ -188,3 +190,63 @@ message ( STATUS "GraphBLAS version: ${GRAPHBLAS_VERSION}" ) message ( STATUS "GraphBLAS include: ${GRAPHBLAS_INCLUDE_DIR}" ) message ( STATUS "GraphBLAS library: ${GRAPHBLAS_LIBRARY}" ) message ( STATUS "GraphBLAS static: ${GRAPHBLAS_STATIC}" ) + +if ( NOT _shared_is_aliased AND GRAPHBLAS_LIBRARY ) + # Get library name from filename of library + # This might be something like: + # /usr/lib/libgraphblas.so or /usr/lib/libgraphblas.a or graphblas64 + # convert to library name that can be used with -l flags for pkg-config + set ( GRAPHBLAS_LIBRARY_TMP ${GRAPHBLAS_LIBRARY} ) + string ( FIND ${GRAPHBLAS_LIBRARY} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( _graphblas_library_name ${GRAPHBLAS_LIBRARY} ) + else ( ) + set ( _kinds "SHARED" "STATIC" ) + if ( WIN32 ) + list ( PREPEND _kinds "IMPORT" ) + endif ( ) + foreach ( _kind IN LISTS _kinds ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${GRAPHBLAS_LIBRARY} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${GRAPHBLAS_LIBRARY} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( _graphblas_library_name ${_libname} ) + break () + endif ( ) + endif ( ) + endforeach ( ) + endif ( ) + + set_target_properties ( SuiteSparse::GraphBLAS PROPERTIES + OUTPUT_NAME ${_graphblas_library_name} ) +endif ( ) + +if ( GRAPHBLAS_STATIC ) + # Get library name from filename of library + # This might be something like: + # /usr/lib/libgraphblas.so or /usr/lib/libgraphblas.a or graphblas64 + # convert to library name that can be used with -l flags for pkg-config + set ( GRAPHBLAS_LIBRARY_TMP ${GRAPHBLAS_STATIC} ) + string ( FIND ${GRAPHBLAS_STATIC} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( _graphblas_library_name ${GRAPHBLAS_STATIC} ) + else ( ) + set ( _kinds "SHARED" "STATIC" ) + if ( WIN32 ) + list ( PREPEND _kinds "IMPORT" ) + endif ( ) + foreach ( _kind IN LISTS _kinds ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${GRAPHBLAS_STATIC} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${GRAPHBLAS_STATIC} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( _graphblas_library_name ${_libname} ) + break () + endif ( ) + endif ( ) + endforeach ( ) + endif ( ) + + set_target_properties ( SuiteSparse::GraphBLAS_static PROPERTIES + OUTPUT_NAME ${_graphblas_library_name} ) +endif ( ) diff --git a/GraphBLAS/Config/README.md.in b/GraphBLAS/Config/README.md.in index 08a764fa63..177217a840 100644 --- a/GraphBLAS/Config/README.md.in +++ b/GraphBLAS/Config/README.md.in @@ -1,6 +1,6 @@ # SuiteSparse:GraphBLAS -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 @@ -63,7 +63,7 @@ README.md file with further details. CMakeLists.txt: cmake instructions to compile GraphBLAS -cmake_modules: additional cmake files +`cmake_modules`: additional cmake files Config: version-dependent files used by CMake @@ -100,7 +100,7 @@ CUDA: GPU interface, a work in progress. This is being developed in CONTRIBUTOR-LICENSE.txt: how to contribute to SuiteSparse:GraphBLAS -cpu_features: (c) Google.com, Apache 2.0 license. +`cpu_features`: (c) Google.com, Apache 2.0 license. logo: the (awesome!) GraphBLAS logo by Jakab Rokob, CC BY 4.0 license @@ -108,7 +108,7 @@ lz4: LZ4 compression, (c) 2011-2016, Yann Collet, BSD2 license zstd: ZSTD compression, (c) Meta, by Yann Collet, BSD3 license xxHash: xxHash code, (c) 2012-2021, Yann Collet -rmm_wrap: Rapids Memory Manager, (c) NVIDIA, to use with CUDA. +`rmm_wrap`: Rapids Memory Manager, (c) NVIDIA, to use with CUDA. (draft; not yet in use) @@ -128,9 +128,9 @@ PreJIT: a folder for JIT kernels that are to be integrated into the Versions v5.2.0 and earlier conform to the version 1.3.0 (Sept 25, 2019) of the GraphBLAS C API Specification. Versions v6.0.0 and later conform to the -version 2.0.0 (Nov, 2021) of the GraphBLAS C API Specification. This library -also includes several additional functions and features as extensions to the -spec. +version 2.0.0 (Nov, 2021) of the GraphBLAS C API Specification. Versions +9.0.0 and later conform to the v2.1.0 C API. This library also includes +several additional functions and features as extensions to the spec. All functions, objects, and macros with the prefix GxB are extensions to the spec. Functions, objects, and macros with prefix GB must not be accessed @@ -196,7 +196,7 @@ To support the development of GraphBLAS, contact the author (davis@tamu.edu) or the Texas A&M Foundation (True Brown, tbrown@txamfoundation.com; or Kevin McGinnis, kmcginnis@txamfoundation.com) for details. -SuiteSparse:GraphBLAS, is copyrighted by Timothy A. Davis, (c) 2017-2023, All +SuiteSparse:GraphBLAS, is copyrighted by Timothy A. Davis, (c) 2017-2024, All Rights Reserved. davis@tamu.edu. ----------------------------------------------------------------------------- @@ -244,7 +244,7 @@ file, and in the GraphBLAS User Guide): (1) LZ4, xxHash, and ZSTD by Yann Collet, appearing here under the BSD2 or BSD3 licenses. -(2) cpu_features (c) Google, Apache 2.0 license with components (c) IBM and -Intel (also Apache 2.0), and the cpu_featurer/ndk_compat component (c) +(2) `cpu_features` (c) Google, Apache 2.0 license with components (c) IBM and +Intel (also Apache 2.0), and the `cpu_featurer/ndk_compat` component (c) The Android Open Source Project (BSD-2-clause) diff --git a/GraphBLAS/Demo/Include/graphblas_demos.h b/GraphBLAS/Demo/Include/graphblas_demos.h index b12c52e7ed..d775bf705f 100644 --- a/GraphBLAS/Demo/Include/graphblas_demos.h +++ b/GraphBLAS/Demo/Include/graphblas_demos.h @@ -56,6 +56,7 @@ #include "GraphBLAS.h" #undef I #include "simple_rand.h" +// #include "usercomplex.h" #undef MIN #undef MAX diff --git a/GraphBLAS/Demo/Include/import_test.c b/GraphBLAS/Demo/Include/import_test.c index 5e74f8af55..aaf701d46c 100644 --- a/GraphBLAS/Demo/Include/import_test.c +++ b/GraphBLAS/Demo/Include/import_test.c @@ -8,6 +8,7 @@ //------------------------------------------------------------------------------ #include "GraphBLAS.h" +#undef I #include "graphblas_demos.h" #if defined __INTEL_COMPILER diff --git a/GraphBLAS/Demo/Output/gauss_demo.out b/GraphBLAS/Demo/Output/gauss_demo.out index af441d5155..f6afbec372 100644 --- a/GraphBLAS/Demo/Output/gauss_demo.out +++ b/GraphBLAS/Demo/Output/gauss_demo.out @@ -11,7 +11,7 @@ JIT C flags: [ -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast JIT C link flags: [ -shared ] JIT C libraries: [ -lm -ldl -lgomp -lpthread] JIT C preface: [] -JIT cache: [/home/faculty/d/davis/.SuiteSparse/GrB8.3.0] +JIT cache: [/home/faculty/d/davis/.SuiteSparse/GrB9.0.0] JIT C control: [4] JIT C control: [4] reset ------------------------------------- @@ -29,16 +29,16 @@ JIT C preface (revised): -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4' -[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/b4/GB_jit__user_type__0__gauss.c.o +-- 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 [100%] Linking C shared library libGB_jit__user_type__0__gauss.so [100%] Built target GB_jit__user_type__0__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/b4/libGB_jit__user_type__0__gauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/b4/libGB_jit__user_type__0__gauss.so - 0.583 sec ] + 0.617 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) @@ -50,20 +50,20 @@ gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2 -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4' -[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/b4/GB_jit__user_type__0__gauss.c.o +-- 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 [100%] Linking C shared library libGB_jit__user_type__0__gauss.so [100%] Built target GB_jit__user_type__0__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/b4/libGB_jit__user_type__0__gauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/b4/libGB_jit__user_type__0__gauss.so - 0.6 sec ] + 0.596 sec ] GraphBLAS type: Gauss user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; [ GxB_Type_new - 7.53e-06 sec ] + 1.2e-05 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) @@ -75,16 +75,16 @@ gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2 -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b' -[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/1b/GB_jit__user_op__0__addgauss.c.o +-- 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 [100%] Linking C shared library libGB_jit__user_op__0__addgauss.so [100%] Built target GB_jit__user_op__0__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/1b/libGB_jit__user_op__0__addgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so - 0.608 sec ] + 0.605 sec ] GraphBLAS BinaryOp: BadAddGauss (user-defined): z=addgauss(x,y) GraphBLAS type: ztype user-defined: [gauss] size: 8 @@ -107,16 +107,16 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b' -[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/1b/GB_jit__user_op__0__addgauss.c.o +-- 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 [100%] Linking C shared library libGB_jit__user_op__0__addgauss.so [100%] Built target GB_jit__user_op__0__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/1b/libGB_jit__user_op__0__addgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so - 0.596 sec ] + 0.614 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) GraphBLAS type: ztype user-defined: [gauss] size: 8 @@ -131,7 +131,7 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) z->imag = x->imag + y->imag ; } [ GxB_BinaryOp_new - 6.59e-06 sec ] + 6.98e-06 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) GraphBLAS type: ztype user-defined: [gauss] size: 8 @@ -216,12 +216,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) work:16 gpus:0 (jit: load) - 0.00023 sec ] + [ GrB_reduce (A bitmap) (jit: load) + 0.000144 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.000294 sec ] + 0.000198 sec ] =============== Gauss A = A^2 matrix: @@ -232,8 +232,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_reduce (A full) work:16 gpus:0 (jit: load) - 0.000164 sec ] + [ GrB_reduce (A full) (jit: load) + 0.000102 sec ] sum (A^2) = (387,46) @@ -246,12 +246,11 @@ row 2: . . . . row 3: . . . . [ GxB_set (full to sparse) - 2.09e-05 sec ] + 1.09e-05 sec ] [ GxB_set (hyper to sparse) - 1.1e-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) work:16 GPUs:0 Not using cuda path. -nthreads 1 ntasks 1 (jit: load) (sparse to bitmap) (jit: load) - 0.000475 sec ] + 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 ] =============== Gauss C = diag(AA') matrix: @@ -263,11 +262,11 @@ row 2: . . (2893, 768) . row 3: . . . (5108,1456) [ GxB_set - 7.67e-07 sec ] + 4.82e-07 sec ] [ GxB_set (hyper to sparse) - 8.94e-06 sec ] + 5.16e-06 sec ] [ GrB_select (A dense) - 3.06e-05 sec ] + 3.13e-05 sec ] Gauss D matrix @@ -278,7 +277,7 @@ row 2: . . ( 30, 0) . row 3: . . . ( 42, -16) [ GrB_mxm C=A*B, colscale (Sf=Sf*S) (jit: load) - 0.000186 sec ] + 0.000133 sec ] =============== Gauss C = D*A matrix: @@ -290,9 +289,9 @@ row 2: ( 810, 480) ( 840, 360) ( 900, 0) ( 960,-360) row 3: (1864, 348) (1852, 64) (1680,-640) (1508,-1344) [ GxB_set - 4.31e-07 sec ] + 3.64e-07 sec ] [ GxB_set (sparse to bitmap) - 1.29e-05 sec ] + 6.43e-06 sec ] Gauss D matrix (bitmap) @@ -305,7 +304,7 @@ row 3: . . . ( 42, -16) 4x4 GraphBLAS gauss matrix, bitmap by row sparsity control: bitmap only - D, 4 entries, memory: 360 bytes + D, 4 entries, memory: 376 bytes (0,0) [user-defined value] (1,1) [user-defined value] @@ -313,7 +312,7 @@ row 3: . . . ( 42, -16) (3,3) [user-defined value] [ GxB_set (bitmap to sparse) - 1.43e-05 sec ] + 1.01e-05 sec ] Gauss D matrix (back to sparse) @@ -326,7 +325,7 @@ row 3: . . . ( 42, -16) 4x4 GraphBLAS gauss matrix, sparse by row sparsity control: sparse only - D, 4 entries, memory: 320 bytes + D, 4 entries, memory: 336 bytes (0,0) [user-defined value] (1,1) [user-defined value] @@ -334,7 +333,7 @@ row 3: . . . ( 42, -16) (3,3) [user-defined value] [ GrB_mxm C=A*B, rowscale (Sf=S*Sf) (jit: load) - 0.000181 sec ] + 0.000128 sec ] =============== Gauss C = A*D matrix: @@ -346,7 +345,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 - 4.1e-05 sec ] + 3.02e-05 sec ] =============== Gauss C = (1,-2) matrix: @@ -368,7 +367,7 @@ 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.000185 sec ] + 0.000126 sec ] =============== Gauss C += A*A' matrix: @@ -380,7 +379,7 @@ 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.16e-05 sec ] + 1.29e-05 sec ] =============== Gauss B = (1,-2) matrix: @@ -392,7 +391,7 @@ 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.000194 sec ] + 0.000147 sec ] =============== Gauss C += B*A: @@ -404,7 +403,7 @@ 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.000177 sec ] + 0.000126 sec ] =============== Gauss C += A*B: @@ -416,7 +415,7 @@ 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.000171 sec ] + 0.000121 sec ] =============== Gauss C = (1,-2) + A: @@ -428,7 +427,7 @@ 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.000152 sec ] + 0.000106 sec ] =============== Gauss C = A*(1,-2): @@ -440,7 +439,7 @@ 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.00019 sec ] + 0.000134 sec ] =============== Gauss C = A'*(1,-2): @@ -452,7 +451,7 @@ 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.000176 sec ] + 0.000121 sec ] =============== Gauss C = (1,-2)*A': @@ -473,10 +472,10 @@ void realgauss (int32_t *z, const gauss *x) (*z) = x->real ; } [ GrB_apply (shallow-op) (jit: load) - 0.00016 sec ] + 0.000159 sec ] 4x4 GraphBLAS int32_t matrix, full by row - R, 16 entries, memory: 280 bytes + R, 16 entries, memory: 296 bytes (0,0) 17 (0,1) 38 @@ -506,10 +505,10 @@ 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.000193 sec ] + 0.000125 sec ] 4x4 GraphBLAS int32_t matrix, full by row - R, 16 entries, memory: 280 bytes + R, 16 entries, memory: 296 bytes (0,0) 17 (0,1) 11 @@ -539,12 +538,12 @@ 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.00017 sec ] + 0.000119 sec ] R = ijgauss (C) 4x4 GraphBLAS int64_t matrix, full by row - R, 16 entries, memory: 344 bytes + R, 16 entries, memory: 360 bytes (0,0) 18 (0,1) 38 @@ -563,8 +562,8 @@ R = ijgauss (C) (3,2) 10 (3,3) 11 - [ GrB_Matrix_extractTuples (A full) (jit: load) - 0.000162 sec ] + [ GrB_Matrix_extractTuples (A full) + 3.29e-05 sec ] R (0,0) = 18 R (0,1) = 38 R (0,2) = 58 @@ -592,7 +591,7 @@ 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.000164 sec ] + 0.000161 sec ] =============== C = C' @@ -604,9 +603,9 @@ 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.71e-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) (jit: load) (jit: load) (jit: load) - 0.000687 sec ] + 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 ] =============== Z = [C D ; E E ; D C] @@ -870,7 +869,7 @@ row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60 256x8 GraphBLAS gauss matrix, sparse by col - Z, 40 entries, memory: 928 bytes + Z, 40 entries, memory: 944 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -913,8 +912,8 @@ row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60 (254,7) [user-defined value] (255,7) [user-defined value] - [ GxB_Matrix_split (sparse/hyper split) (jit: load) - 0.000201 sec ] + [ GxB_Matrix_split (sparse/hyper split) + 2.96e-05 sec ] =============== C Tile from Z: @@ -1051,7 +1050,7 @@ row 127: . . . 128x3 GraphBLAS gauss matrix, sparse by col - CTiles [k], 12 entries, memory: 440 bytes + CTiles [k], 12 entries, memory: 456 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -1202,7 +1201,7 @@ row 127: . . . . . 128x5 GraphBLAS gauss matrix, sparse by col - CTiles [k], 8 entries, memory: 392 bytes + CTiles [k], 8 entries, memory: 408 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -1349,7 +1348,7 @@ row 127: . . . 128x3 GraphBLAS gauss matrix, sparse by col - CTiles [k], 3 entries, memory: 296 bytes + CTiles [k], 3 entries, memory: 312 bytes (124,0) [user-defined value] (125,1) [user-defined value] @@ -1491,7 +1490,7 @@ row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) 128x5 GraphBLAS gauss matrix, sparse by col - CTiles [k], 17 entries, memory: 536 bytes + CTiles [k], 17 entries, memory: 552 bytes (127,0) [user-defined value] (124,1) [user-defined value] @@ -1512,9 +1511,9 @@ row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) (127,4) [user-defined value] [ GxB_set (in-place transpose) (transpose) - 7.88e-06 sec ] - [ GxB_Matrix_concat (bitmap concat) (transpose) (bitmap/full transpose) (jit: load) (transpose) (jit: load) (transpose) (1-thread bucket transpose) (jit: load) (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) - 0.000361 sec ] + 7.28e-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 ] =============== Z = [C D ; E E ; D C] @@ -1538,7 +1537,7 @@ row 15: . . . ( 42, -16) ( 80, -50) ( 70, -60) 16x8 GraphBLAS gauss matrix, bitmap by col - Z, 40 entries, memory: 1.3 KB + Z, 40 entries, memory: 1.4 KB (0,0) [user-defined value] (1,0) [user-defined value] @@ -1581,8 +1580,8 @@ row 15: . . . ( 42, -16) ( 80, -50) ( 70, -60) (14,7) [user-defined value] (15,7) [user-defined value] - [ GxB_Matrix_split (bitmap split) (jit: load) - 0.000117 sec ] + [ GxB_Matrix_split (bitmap split) + 1.49e-05 sec ] =============== C Tile from Z: @@ -1599,7 +1598,7 @@ row 7: . . . 8x3 GraphBLAS gauss matrix, bitmap by col - CTiles [k], 12 entries, memory: 432 bytes + CTiles [k], 12 entries, memory: 448 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -1630,7 +1629,7 @@ row 7: . . . . . 8x5 GraphBLAS gauss matrix, bitmap by col - CTiles [k], 8 entries, memory: 576 bytes + CTiles [k], 8 entries, memory: 592 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -1657,7 +1656,7 @@ row 7: . . . 8x3 GraphBLAS gauss matrix, bitmap by col - CTiles [k], 3 entries, memory: 432 bytes + CTiles [k], 3 entries, memory: 448 bytes (4,0) [user-defined value] (5,1) [user-defined value] @@ -1679,7 +1678,7 @@ row 7: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) 8x5 GraphBLAS gauss matrix, bitmap by col - CTiles [k], 17 entries, memory: 576 bytes + CTiles [k], 17 entries, memory: 592 bytes (7,0) [user-defined value] (4,1) [user-defined value] @@ -1700,7 +1699,7 @@ row 7: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) (7,4) [user-defined value] [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: load) - 0.000118 sec ] + 0.000165 sec ] =============== C = C + ciso @@ -1712,9 +1711,9 @@ row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) [ GxB_set - 2.73e-07 sec ] - [ GxB_Matrix_split (full split) (jit: load) - 0.000108 sec ] + 2.72e-07 sec ] + [ GxB_Matrix_split (full split) + 1.53e-05 sec ] =============== S Tile from C: @@ -1725,7 +1724,7 @@ row 0: ( 18, -16) ( 12, -19) 1x2 GraphBLAS gauss matrix, full by row sparsity control: full - STiles [k], 2 entries, memory: 232 bytes + STiles [k], 2 entries, memory: 248 bytes (0,0) [user-defined value] (0,1) [user-defined value] @@ -1740,7 +1739,7 @@ row 0: ( 6, -22) ( 0, -25) 1x2 GraphBLAS gauss matrix, full by row sparsity control: full - STiles [k], 2 entries, memory: 232 bytes + STiles [k], 2 entries, memory: 248 bytes (0,0) [user-defined value] (0,1) [user-defined value] @@ -1757,7 +1756,7 @@ row 2: ( 81, -52) ( 71, -62) 3x2 GraphBLAS gauss matrix, full by row sparsity control: full - STiles [k], 6 entries, memory: 264 bytes + STiles [k], 6 entries, memory: 280 bytes (0,0) [user-defined value] (0,1) [user-defined value] @@ -1778,7 +1777,7 @@ row 2: ( 41, -82) ( 11,-102) 3x2 GraphBLAS gauss matrix, full by row sparsity control: full - STiles [k], 6 entries, memory: 264 bytes + STiles [k], 6 entries, memory: 280 bytes (0,0) [user-defined value] (0,1) [user-defined value] @@ -1799,7 +1798,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.47e-05 sec ] + 1.69e-05 sec ] =============== C = C + ciso (JIT paused): @@ -1821,7 +1820,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) - 1e-05 sec ] + 1.07e-05 sec ] =============== C = C * ciso (JIT paused): @@ -1834,7 +1833,7 @@ row 3: ( -26,-218) ( -56,-208) (-126,-168) (-196,-128) JIT: run (may not load or compile) [ GrB_assign (pending: 0) Method 22: (C full) += scalar - 7.75e-06 sec ] + 8.46e-06 sec ] =============== C = C + ciso (JIT run): @@ -1846,7 +1845,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) - 1e-05 sec ] + 1.01e-05 sec ] =============== C = C * ciso (JIT not loaded): @@ -1859,7 +1858,7 @@ row 3: (-465,-170) (-475,-100) (-465, 80) (-455, 260) JIT: on [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: load) - 0.000112 sec ] + 0.000127 sec ] =============== C = C * ciso (full JIT): diff --git a/GraphBLAS/Demo/Output/gauss_demo1.out b/GraphBLAS/Demo/Output/gauss_demo1.out index 90a7cb21a3..3fd296ca1c 100644 --- a/GraphBLAS/Demo/Output/gauss_demo1.out +++ b/GraphBLAS/Demo/Output/gauss_demo1.out @@ -11,7 +11,7 @@ JIT C flags: [ -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast JIT C link flags: [ -shared ] JIT C libraries: [ -lm -ldl -lgomp -lpthread] JIT C preface: [] -JIT cache: [/home/faculty/d/davis/.SuiteSparse/GrB8.3.0] +JIT cache: [/home/faculty/d/davis/.SuiteSparse/GrB9.0.0] JIT C control: [4] JIT C control: [4] reset ------------------------------------- @@ -29,16 +29,16 @@ JIT C preface (revised): -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4' -[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/b4/GB_jit__user_type__0__gauss.c.o +-- 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 [100%] Linking C shared library libGB_jit__user_type__0__gauss.so [100%] Built target GB_jit__user_type__0__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/b4/libGB_jit__user_type__0__gauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/b4/libGB_jit__user_type__0__gauss.so - 0.598 sec ] + 0.586 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) @@ -50,20 +50,20 @@ gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2 -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4' -[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/b4/GB_jit__user_type__0__gauss.c.o +-- 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 [100%] Linking C shared library libGB_jit__user_type__0__gauss.so [100%] Built target GB_jit__user_type__0__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2be202506bf1b4' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/b4/libGB_jit__user_type__0__gauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/b4/libGB_jit__user_type__0__gauss.so - 0.595 sec ] + 0.603 sec ] GraphBLAS type: Gauss user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; [ GxB_Type_new - 1.03e-05 sec ] + 1.09e-05 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) @@ -75,16 +75,16 @@ gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ce2 -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b' -[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/1b/GB_jit__user_op__0__addgauss.c.o +-- 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 [100%] Linking C shared library libGB_jit__user_op__0__addgauss.so [100%] Built target GB_jit__user_op__0__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/1b/libGB_jit__user_op__0__addgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so - 0.608 sec ] + 0.617 sec ] GraphBLAS BinaryOp: BadAddGauss (user-defined): z=addgauss(x,y) GraphBLAS type: ztype user-defined: [gauss] size: 8 @@ -107,16 +107,16 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b' -[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/1b/GB_jit__user_op__0__addgauss.c.o +-- 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 [100%] Linking C shared library libGB_jit__user_op__0__addgauss.so [100%] Built target GB_jit__user_op__0__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/af7c00a52397011b' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/1b/libGB_jit__user_op__0__addgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so - 0.624 sec ] + 0.598 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) GraphBLAS type: ztype user-defined: [gauss] size: 8 @@ -131,7 +131,7 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) z->imag = x->imag + y->imag ; } [ GxB_BinaryOp_new - 7.3e-06 sec ] + 8.62e-06 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) GraphBLAS type: ztype user-defined: [gauss] size: 8 @@ -216,7 +216,7 @@ 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) work:16 gpus:0 (jit: compile and load) (jit: cmake) + [ GrB_reduce (A bitmap) (jit: compile and load) (jit: cmake) -- The C compiler identification is GNU 9.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done @@ -225,16 +225,16 @@ row 3: ( 4, 2) ( 4, 1) ( 4, 0) ( 4, -1) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/30e2328e57edb8cc -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/30e2328e57edb8cc' -[ 50%] Building C object CMakeFiles/GB_jit__reduce__83feee2__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/cc/GB_jit__reduce__83feee2__addgauss.c.o +-- 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/GrB8.3.0/tmp/30e2328e57edb8cc' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/30e2328e57edb8cc' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/cc/libGB_jit__reduce__83feee2__addgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/cc/libGB_jit__reduce__83feee2__addgauss.so - 0.667 sec ] + 0.656 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) @@ -246,16 +246,16 @@ sum (A) = (39,6) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/e335728df7d8fc68 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/e335728df7d8fc68' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/68/GB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss.c.o +-- 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/GrB8.3.0/tmp/e335728df7d8fc68' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/e335728df7d8fc68' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/68/libGB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/68/libGB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss.so (bitmap to full) - 0.774 sec ] + 0.769 sec ] =============== Gauss A = A^2 matrix: @@ -266,7 +266,7 @@ 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) work:16 gpus:0 (jit: compile and load) (jit: cmake) + [ GrB_reduce (A full) (jit: compile and load) (jit: cmake) -- The C compiler identification is GNU 9.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done @@ -275,16 +275,16 @@ row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/216cc7a07453b1ee -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/216cc7a07453b1ee' -[ 50%] Building C object CMakeFiles/GB_jit__reduce__83feee3__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/ee/GB_jit__reduce__83feee3__addgauss.c.o +-- 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/GrB8.3.0/tmp/216cc7a07453b1ee' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/216cc7a07453b1ee' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/ee/libGB_jit__reduce__83feee3__addgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/ee/libGB_jit__reduce__83feee3__addgauss.so - 0.708 sec ] + 0.74 sec ] sum (A^2) = (387,46) @@ -297,11 +297,10 @@ row 2: . . . . row 3: . . . . [ GxB_set (full to sparse) - 1.35e-05 sec ] + 2.34e-05 sec ] [ GxB_set (hyper to sparse) - 8.36e-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) work:16 GPUs:0 Not using cuda path. -nthreads 1 ntasks 1 (jit: compile and load) (jit: cmake) + 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 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done @@ -310,33 +309,16 @@ nthreads 1 ntasks 1 (jit: compile and load) (jit: cmake) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/67a80190c429079f -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/67a80190c429079f' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_dot3__03fe100eee2eee55__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/9f/GB_jit__AxB_dot3__03fe100eee2eee55__addgauss_multgauss.c.o +-- 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/GrB8.3.0/tmp/67a80190c429079f' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/67a80190c429079f' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/9f/libGB_jit__AxB_dot3__03fe100eee2eee55__addgauss_multgauss.so -(sparse to bitmap) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/be2424ff0149b586 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/be2424ff0149b586' -[ 50%] Building C object CMakeFiles/GB_jit__convert_s2b__0002ee0eed__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/86/GB_jit__convert_s2b__0002ee0eed__gauss.c.o -[100%] Linking C shared library libGB_jit__convert_s2b__0002ee0eed__gauss.so -[100%] Built target GB_jit__convert_s2b__0002ee0eed__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/be2424ff0149b586' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/86/libGB_jit__convert_s2b__0002ee0eed__gauss.so - - 1.32 sec ] +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/9f/libGB_jit__AxB_dot3__03fe100eee2eee55__addgauss_multgauss.so +(sparse to bitmap) + 0.719 sec ] =============== Gauss C = diag(AA') matrix: @@ -348,11 +330,11 @@ row 2: . . (2893, 768) . row 3: . . . (5108,1456) [ GxB_set - 1.61e-06 sec ] + 1.33e-06 sec ] [ GxB_set (hyper to sparse) - 9.37e-06 sec ] + 8.97e-06 sec ] [ GrB_select (A dense) - 3.26e-05 sec ] + 5.52e-05 sec ] Gauss D matrix @@ -371,16 +353,16 @@ row 3: . . . ( 42, -16) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/dd2129670608a0a3 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/dd2129670608a0a3' -[ 50%] Building C object CMakeFiles/GB_jit__colscale__0100eee0eee45__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/a3/GB_jit__colscale__0100eee0eee45__multgauss.c.o +-- 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/GrB8.3.0/tmp/dd2129670608a0a3' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/dd2129670608a0a3' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/a3/libGB_jit__colscale__0100eee0eee45__multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/a3/libGB_jit__colscale__0100eee0eee45__multgauss.so - 0.637 sec ] + 0.622 sec ] =============== Gauss C = D*A matrix: @@ -392,9 +374,9 @@ row 2: ( 810, 480) ( 840, 360) ( 900, 0) ( 960,-360) row 3: (1864, 348) (1852, 64) (1680,-640) (1508,-1344) [ GxB_set - 9.27e-07 sec ] + 1.08e-06 sec ] [ GxB_set (sparse to bitmap) - 1.75e-05 sec ] + 1.35e-05 sec ] Gauss D matrix (bitmap) @@ -407,7 +389,7 @@ row 3: . . . ( 42, -16) 4x4 GraphBLAS gauss matrix, bitmap by row sparsity control: bitmap only - D, 4 entries, memory: 360 bytes + D, 4 entries, memory: 376 bytes (0,0) [user-defined value] (1,1) [user-defined value] @@ -415,7 +397,7 @@ row 3: . . . ( 42, -16) (3,3) [user-defined value] [ GxB_set (bitmap to sparse) - 2.67e-05 sec ] + 1.5e-05 sec ] Gauss D matrix (back to sparse) @@ -428,7 +410,7 @@ row 3: . . . ( 42, -16) 4x4 GraphBLAS gauss matrix, sparse by row sparsity control: sparse only - D, 4 entries, memory: 320 bytes + D, 4 entries, memory: 336 bytes (0,0) [user-defined value] (1,1) [user-defined value] @@ -444,16 +426,16 @@ row 3: . . . ( 42, -16) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/96b50768cfd669a8 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/96b50768cfd669a8' -[ 50%] Building C object CMakeFiles/GB_jit__rowscale__0100eee0eee45__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/a8/GB_jit__rowscale__0100eee0eee45__multgauss.c.o +-- 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/GrB8.3.0/tmp/96b50768cfd669a8' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/96b50768cfd669a8' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/a8/libGB_jit__rowscale__0100eee0eee45__multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/a8/libGB_jit__rowscale__0100eee0eee45__multgauss.so - 0.634 sec ] + 0.597 sec ] =============== Gauss C = A*D matrix: @@ -465,7 +447,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.38e-05 sec ] + 3.96e-05 sec ] =============== Gauss C = (1,-2) matrix: @@ -495,16 +477,16 @@ row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/7acb8bd141ca27c9 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/7acb8bd141ca27c9' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/c9/GB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss.c.o +-- 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/GrB8.3.0/tmp/7acb8bd141ca27c9' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/7acb8bd141ca27c9' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/c9/libGB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/c9/libGB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss.so (C in place) - 0.678 sec ] + 0.675 sec ] =============== Gauss C += A*A' matrix: @@ -516,7 +498,7 @@ 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.18e-05 sec ] + 2.82e-05 sec ] =============== Gauss B = (1,-2) matrix: @@ -536,16 +518,16 @@ row 3: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/5301828568d7f863 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/5301828568d7f863' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/63/GB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss.c.o +-- 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/GrB8.3.0/tmp/5301828568d7f863' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/5301828568d7f863' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/63/libGB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/63/libGB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss.so (C in place) - 1.01 sec ] + 1.05 sec ] =============== Gauss C += B*A: @@ -565,16 +547,16 @@ row 3: (1415, -40) (2748, 509) (3940, 856) (5132,1203) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/c94d1f86a5825b56 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/c94d1f86a5825b56' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/56/GB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss.c.o +-- 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/GrB8.3.0/tmp/c94d1f86a5825b56' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/c94d1f86a5825b56' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/56/libGB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/56/libGB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss.so (C in place) - 0.647 sec ] + 0.644 sec ] =============== Gauss C += A*B: @@ -594,16 +576,16 @@ row 3: (1615,-330) (2948, 219) (4140, 566) (5332, 913) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/3b6448d781104419 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/3b6448d781104419' -[ 50%] Building C object CMakeFiles/GB_jit__apply_bind1st__0000eee0efec1__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/19/GB_jit__apply_bind1st__0000eee0efec1__addgauss.c.o +-- 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/GrB8.3.0/tmp/3b6448d781104419' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/3b6448d781104419' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/19/libGB_jit__apply_bind1st__0000eee0efec1__addgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/19/libGB_jit__apply_bind1st__0000eee0efec1__addgauss.so - 0.615 sec ] + 0.618 sec ] =============== Gauss C = (1,-2) + A: @@ -623,16 +605,16 @@ row 3: ( 37, 20) ( 39, 14) ( 41, -2) ( 43, -18) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/42813a1e14cb43c9 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/42813a1e14cb43c9' -[ 50%] Building C object CMakeFiles/GB_jit__apply_bind2nd__0000eee0eefc4__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/c9/GB_jit__apply_bind2nd__0000eee0eefc4__multgauss.c.o +-- 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/GrB8.3.0/tmp/42813a1e14cb43c9' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/42813a1e14cb43c9' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/c9/libGB_jit__apply_bind2nd__0000eee0eefc4__multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/c9/libGB_jit__apply_bind2nd__0000eee0eefc4__multgauss.so - 0.655 sec ] + 0.665 sec ] =============== Gauss C = A*(1,-2): @@ -652,16 +634,16 @@ row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/37d33aa629f415d3 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/37d33aa629f415d3' -[ 50%] Building C object CMakeFiles/GB_jit__trans_bind2nd__0000eee0eef44__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/d3/GB_jit__trans_bind2nd__0000eee0eef44__multgauss.c.o +-- 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/GrB8.3.0/tmp/37d33aa629f415d3' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/37d33aa629f415d3' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/d3/libGB_jit__trans_bind2nd__0000eee0eef44__multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/d3/libGB_jit__trans_bind2nd__0000eee0eef44__multgauss.so (full to sparse) - 0.668 sec ] + 0.679 sec ] =============== Gauss C = A'*(1,-2): @@ -681,16 +663,16 @@ row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/07d1cb825d4304d3 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/07d1cb825d4304d3' -[ 50%] Building C object CMakeFiles/GB_jit__trans_bind1st__0000eee0efe41__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/d3/GB_jit__trans_bind1st__0000eee0efe41__multgauss.c.o +-- 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/GrB8.3.0/tmp/07d1cb825d4304d3' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/07d1cb825d4304d3' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/d3/libGB_jit__trans_bind1st__0000eee0efe41__multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/d3/libGB_jit__trans_bind1st__0000eee0efe41__multgauss.so (full to sparse) - 0.673 sec ] + 0.678 sec ] =============== Gauss C = (1,-2)*A': @@ -719,19 +701,19 @@ void realgauss (int32_t *z, const gauss *x) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/5c78101d6e73dc21 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/5c78101d6e73dc21' -[ 50%] Building C object CMakeFiles/GB_jit__apply_unop__00006e06ef__realgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/21/GB_jit__apply_unop__00006e06ef__realgauss.c.o +-- 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/GrB8.3.0/tmp/5c78101d6e73dc21' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/5c78101d6e73dc21' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/21/libGB_jit__apply_unop__00006e06ef__realgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/21/libGB_jit__apply_unop__00006e06ef__realgauss.so - 0.621 sec ] + 0.639 sec ] 4x4 GraphBLAS int32_t matrix, full by row - R, 16 entries, memory: 280 bytes + R, 16 entries, memory: 296 bytes (0,0) 17 (0,1) 38 @@ -769,19 +751,19 @@ row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/b799fc2c5b29ec49 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/b799fc2c5b29ec49' -[ 50%] Building C object CMakeFiles/GB_jit__trans_unop__08006e06ef__realgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/49/GB_jit__trans_unop__08006e06ef__realgauss.c.o +-- 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/GrB8.3.0/tmp/b799fc2c5b29ec49' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/b799fc2c5b29ec49' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/49/libGB_jit__trans_unop__08006e06ef__realgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/49/libGB_jit__trans_unop__08006e06ef__realgauss.so - 0.631 sec ] + 0.616 sec ] 4x4 GraphBLAS int32_t matrix, full by row - R, 16 entries, memory: 280 bytes + R, 16 entries, memory: 296 bytes (0,0) 17 (0,1) 11 @@ -819,21 +801,21 @@ row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/4e606820337e573c -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/4e606820337e573c' -[ 50%] Building C object CMakeFiles/GB_jit__apply_unop__07fe8ee8ef__ijgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/3c/GB_jit__apply_unop__07fe8ee8ef__ijgauss.c.o +-- 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/GrB8.3.0/tmp/4e606820337e573c' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/4e606820337e573c' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/3c/libGB_jit__apply_unop__07fe8ee8ef__ijgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/3c/libGB_jit__apply_unop__07fe8ee8ef__ijgauss.so - 0.626 sec ] + 0.644 sec ] R = ijgauss (C) 4x4 GraphBLAS int64_t matrix, full by row - R, 16 entries, memory: 344 bytes + R, 16 entries, memory: 360 bytes (0,0) 18 (0,1) 38 @@ -852,25 +834,8 @@ R = ijgauss (C) (3,2) 10 (3,3) 11 - [ GrB_Matrix_extractTuples (A full) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/5660a671ca40c48b -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/5660a671ca40c48b' -[ 50%] Building C object CMakeFiles/GB_jit__apply_unop__0002bb0b8f.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/8b/GB_jit__apply_unop__0002bb0b8f.c.o -[100%] Linking C shared library libGB_jit__apply_unop__0002bb0b8f.so -[100%] Built target GB_jit__apply_unop__0002bb0b8f -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/5660a671ca40c48b' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/8b/libGB_jit__apply_unop__0002bb0b8f.so - - 0.6 sec ] + [ GrB_Matrix_extractTuples (A full) + 4.07e-05 sec ] R (0,0) = 18 R (0,1) = 38 R (0,2) = 58 @@ -906,16 +871,16 @@ row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/20f5326f3ffc493d -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/20f5326f3ffc493d' -[ 50%] Building C object CMakeFiles/GB_jit__trans_unop__0802ee0eef__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/3d/GB_jit__trans_unop__0802ee0eef__gauss.c.o +-- 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/GrB8.3.0/tmp/20f5326f3ffc493d' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/20f5326f3ffc493d' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/3d/libGB_jit__trans_unop__0802ee0eef__gauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/3d/libGB_jit__trans_unop__0802ee0eef__gauss.so - 0.626 sec ] + 0.644 sec ] =============== C = C' @@ -927,7 +892,7 @@ 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.9e-05 sec ] + 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 -- Detecting C compiler ABI info @@ -937,67 +902,16 @@ row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/f6daeb95a8060316 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/f6daeb95a8060316' -[ 50%] Building C object CMakeFiles/GB_jit__trans_unop__0802ee0ee5__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/16/GB_jit__trans_unop__0802ee0ee5__gauss.c.o +-- 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/GrB8.3.0/tmp/f6daeb95a8060316' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/16/libGB_jit__trans_unop__0802ee0ee5__gauss.so -(transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/48b856264c49fbf7 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/48b856264c49fbf7' -[ 50%] Building C object CMakeFiles/GB_jit__concat_sparse__0802ee0ee7__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/f7/GB_jit__concat_sparse__0802ee0ee7__gauss.c.o -[100%] Linking C shared library libGB_jit__concat_sparse__0802ee0ee7__gauss.so -[100%] Built target GB_jit__concat_sparse__0802ee0ee7__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/48b856264c49fbf7' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/f6daeb95a8060316' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/f7/libGB_jit__concat_sparse__0802ee0ee7__gauss.so -(jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/b74773f44d3a63e0 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/b74773f44d3a63e0' -[ 50%] Building C object CMakeFiles/GB_jit__concat_sparse__0802ee0ee4__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/e0/GB_jit__concat_sparse__0802ee0ee4__gauss.c.o -[100%] Linking C shared library libGB_jit__concat_sparse__0802ee0ee4__gauss.so -[100%] Built target GB_jit__concat_sparse__0802ee0ee4__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/b74773f44d3a63e0' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/e0/libGB_jit__concat_sparse__0802ee0ee4__gauss.so -(jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/ca722575fc658dc5 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ca722575fc658dc5' -[ 50%] Building C object CMakeFiles/GB_jit__concat_sparse__0802ee0ee5__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/c5/GB_jit__concat_sparse__0802ee0ee5__gauss.c.o -[100%] Linking C shared library libGB_jit__concat_sparse__0802ee0ee5__gauss.so -[100%] Built target GB_jit__concat_sparse__0802ee0ee5__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/ca722575fc658dc5' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/c5/libGB_jit__concat_sparse__0802ee0ee5__gauss.so - - 2.63 sec ] +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/16/libGB_jit__trans_unop__0802ee0ee5__gauss.so +(transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) + 0.659 sec ] =============== Z = [C D ; E E ; D C] @@ -1261,7 +1175,7 @@ row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60 256x8 GraphBLAS gauss matrix, sparse by col - Z, 40 entries, memory: 928 bytes + Z, 40 entries, memory: 944 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -1304,25 +1218,8 @@ row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60 (254,7) [user-defined value] (255,7) [user-defined value] - [ GxB_Matrix_split (sparse/hyper split) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/bc6fbb55201f367c -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/bc6fbb55201f367c' -[ 50%] Building C object CMakeFiles/GB_jit__split_sparse__0802ee0ee5__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/7c/GB_jit__split_sparse__0802ee0ee5__gauss.c.o -[100%] Linking C shared library libGB_jit__split_sparse__0802ee0ee5__gauss.so -[100%] Built target GB_jit__split_sparse__0802ee0ee5__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/bc6fbb55201f367c' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/7c/libGB_jit__split_sparse__0802ee0ee5__gauss.so - - 0.647 sec ] + [ GxB_Matrix_split (sparse/hyper split) + 3.36e-05 sec ] =============== C Tile from Z: @@ -1459,7 +1356,7 @@ row 127: . . . 128x3 GraphBLAS gauss matrix, sparse by col - CTiles [k], 12 entries, memory: 440 bytes + CTiles [k], 12 entries, memory: 456 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -1610,7 +1507,7 @@ row 127: . . . . . 128x5 GraphBLAS gauss matrix, sparse by col - CTiles [k], 8 entries, memory: 392 bytes + CTiles [k], 8 entries, memory: 408 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -1757,7 +1654,7 @@ row 127: . . . 128x3 GraphBLAS gauss matrix, sparse by col - CTiles [k], 3 entries, memory: 296 bytes + CTiles [k], 3 entries, memory: 312 bytes (124,0) [user-defined value] (125,1) [user-defined value] @@ -1899,7 +1796,7 @@ row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) 128x5 GraphBLAS gauss matrix, sparse by col - CTiles [k], 17 entries, memory: 536 bytes + CTiles [k], 17 entries, memory: 552 bytes (127,0) [user-defined value] (124,1) [user-defined value] @@ -1920,60 +1817,9 @@ row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) (127,4) [user-defined value] [ GxB_set (in-place transpose) (transpose) - 1.6e-05 sec ] - [ GxB_Matrix_concat (bitmap concat) (transpose) (bitmap/full transpose) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/0c3e9de2e5d73a82 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/0c3e9de2e5d73a82' -[ 50%] Building C object CMakeFiles/GB_jit__concat_bitmap__0802ee0eeb__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/82/GB_jit__concat_bitmap__0802ee0eeb__gauss.c.o -[100%] Linking C shared library libGB_jit__concat_bitmap__0802ee0eeb__gauss.so -[100%] Built target GB_jit__concat_bitmap__0802ee0eeb__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/0c3e9de2e5d73a82' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/82/libGB_jit__concat_bitmap__0802ee0eeb__gauss.so -(transpose) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/068b643968f6613c -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/068b643968f6613c' -[ 50%] Building C object CMakeFiles/GB_jit__concat_bitmap__0802ee0ee8__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/3c/GB_jit__concat_bitmap__0802ee0ee8__gauss.c.o -[100%] Linking C shared library libGB_jit__concat_bitmap__0802ee0ee8__gauss.so -[100%] Built target GB_jit__concat_bitmap__0802ee0ee8__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/068b643968f6613c' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/3c/libGB_jit__concat_bitmap__0802ee0ee8__gauss.so -(transpose) (1-thread bucket transpose) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/e363064d750a735e -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/e363064d750a735e' -[ 50%] Building C object CMakeFiles/GB_jit__concat_bitmap__0802ee0ee9__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/5e/GB_jit__concat_bitmap__0802ee0ee9__gauss.c.o -[100%] Linking C shared library libGB_jit__concat_bitmap__0802ee0ee9__gauss.so -[100%] Built target GB_jit__concat_bitmap__0802ee0ee9__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/e363064d750a735e' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/5e/libGB_jit__concat_bitmap__0802ee0ee9__gauss.so -(transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) - 1.97 sec ] + 9.74e-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 ] =============== Z = [C D ; E E ; D C] @@ -1997,7 +1843,7 @@ row 15: . . . ( 42, -16) ( 80, -50) ( 70, -60) 16x8 GraphBLAS gauss matrix, bitmap by col - Z, 40 entries, memory: 1.3 KB + Z, 40 entries, memory: 1.4 KB (0,0) [user-defined value] (1,0) [user-defined value] @@ -2040,25 +1886,8 @@ row 15: . . . ( 42, -16) ( 80, -50) ( 70, -60) (14,7) [user-defined value] (15,7) [user-defined value] - [ GxB_Matrix_split (bitmap split) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/f5d9f01d1b2c9447 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/f5d9f01d1b2c9447' -[ 50%] Building C object CMakeFiles/GB_jit__split_bitmap__0802ee0eea__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/47/GB_jit__split_bitmap__0802ee0eea__gauss.c.o -[100%] Linking C shared library libGB_jit__split_bitmap__0802ee0eea__gauss.so -[100%] Built target GB_jit__split_bitmap__0802ee0eea__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/f5d9f01d1b2c9447' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/47/libGB_jit__split_bitmap__0802ee0eea__gauss.so - - 0.614 sec ] + [ GxB_Matrix_split (bitmap split) + 1.78e-05 sec ] =============== C Tile from Z: @@ -2075,7 +1904,7 @@ row 7: . . . 8x3 GraphBLAS gauss matrix, bitmap by col - CTiles [k], 12 entries, memory: 432 bytes + CTiles [k], 12 entries, memory: 448 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -2106,7 +1935,7 @@ row 7: . . . . . 8x5 GraphBLAS gauss matrix, bitmap by col - CTiles [k], 8 entries, memory: 576 bytes + CTiles [k], 8 entries, memory: 592 bytes (0,0) [user-defined value] (1,0) [user-defined value] @@ -2133,7 +1962,7 @@ row 7: . . . 8x3 GraphBLAS gauss matrix, bitmap by col - CTiles [k], 3 entries, memory: 432 bytes + CTiles [k], 3 entries, memory: 448 bytes (4,0) [user-defined value] (5,1) [user-defined value] @@ -2155,7 +1984,7 @@ row 7: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) 8x5 GraphBLAS gauss matrix, bitmap by col - CTiles [k], 17 entries, memory: 576 bytes + CTiles [k], 17 entries, memory: 592 bytes (7,0) [user-defined value] (4,1) [user-defined value] @@ -2184,16 +2013,16 @@ row 7: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/bcb251ed7f212866 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/bcb251ed7f212866' -[ 50%] Building C object CMakeFiles/GB_jit__subassign_22__1000eee0eec8__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/66/GB_jit__subassign_22__1000eee0eec8__addgauss.c.o +-- 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/GrB8.3.0/tmp/bcb251ed7f212866' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/bcb251ed7f212866' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/66/libGB_jit__subassign_22__1000eee0eec8__addgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/66/libGB_jit__subassign_22__1000eee0eec8__addgauss.so - 0.639 sec ] + 0.643 sec ] =============== C = C + ciso @@ -2205,26 +2034,9 @@ row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) [ GxB_set - 6.48e-07 sec ] - [ GxB_Matrix_split (full split) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - 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/GrB8.3.0/tmp/b25a3ffd809024d5 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/b25a3ffd809024d5' -[ 50%] Building C object CMakeFiles/GB_jit__split_full__0802ee0eef__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/d5/GB_jit__split_full__0802ee0eef__gauss.c.o -[100%] Linking C shared library libGB_jit__split_full__0802ee0eef__gauss.so -[100%] Built target GB_jit__split_full__0802ee0eef__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/b25a3ffd809024d5' --- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/d5/libGB_jit__split_full__0802ee0eef__gauss.so - - 0.612 sec ] + 7.84e-07 sec ] + [ GxB_Matrix_split (full split) + 2.92e-05 sec ] =============== S Tile from C: @@ -2235,7 +2047,7 @@ row 0: ( 18, -16) ( 12, -19) 1x2 GraphBLAS gauss matrix, full by row sparsity control: full - STiles [k], 2 entries, memory: 232 bytes + STiles [k], 2 entries, memory: 248 bytes (0,0) [user-defined value] (0,1) [user-defined value] @@ -2250,7 +2062,7 @@ row 0: ( 6, -22) ( 0, -25) 1x2 GraphBLAS gauss matrix, full by row sparsity control: full - STiles [k], 2 entries, memory: 232 bytes + STiles [k], 2 entries, memory: 248 bytes (0,0) [user-defined value] (0,1) [user-defined value] @@ -2267,7 +2079,7 @@ row 2: ( 81, -52) ( 71, -62) 3x2 GraphBLAS gauss matrix, full by row sparsity control: full - STiles [k], 6 entries, memory: 264 bytes + STiles [k], 6 entries, memory: 280 bytes (0,0) [user-defined value] (0,1) [user-defined value] @@ -2288,7 +2100,7 @@ row 2: ( 41, -82) ( 11,-102) 3x2 GraphBLAS gauss matrix, full by row sparsity control: full - STiles [k], 6 entries, memory: 264 bytes + STiles [k], 6 entries, memory: 280 bytes (0,0) [user-defined value] (0,1) [user-defined value] @@ -2309,7 +2121,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.18e-05 sec ] + 3.51e-05 sec ] =============== C = C + ciso (JIT paused): @@ -2331,7 +2143,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.81e-05 sec ] + 1.82e-05 sec ] =============== C = C * ciso (JIT paused): @@ -2344,7 +2156,7 @@ row 3: ( -26,-218) ( -56,-208) (-126,-168) (-196,-128) JIT: run (may not load or compile) [ GrB_assign (pending: 0) Method 22: (C full) += scalar - 1.4e-05 sec ] + 1.47e-05 sec ] =============== C = C + ciso (JIT run): @@ -2356,7 +2168,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.76e-05 sec ] + 1.82e-05 sec ] =============== C = C * ciso (JIT not loaded): @@ -2377,16 +2189,16 @@ JIT: on -- Detecting C compile features - done -- Configuring done (0.3s) -- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/7a164201169278d1 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/tmp/7a164201169278d1' -[ 50%] Building C object CMakeFiles/GB_jit__subassign_22__1000eee0eec8__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/d1/GB_jit__subassign_22__1000eee0eec8__multgauss.c.o +-- 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/GrB8.3.0/tmp/7a164201169278d1' +gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/7a164201169278d1' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/lib/d1/libGB_jit__subassign_22__1000eee0eec8__multgauss.so +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/d1/libGB_jit__subassign_22__1000eee0eec8__multgauss.so - 0.627 sec ] + 0.661 sec ] =============== C = C * ciso (full JIT): diff --git a/GraphBLAS/Demo/Output/import_demo.out b/GraphBLAS/Demo/Output/import_demo.out index 13be0e9b98..dc72b3c9b0 100644 --- a/GraphBLAS/Demo/Output/import_demo.out +++ b/GraphBLAS/Demo/Output/import_demo.out @@ -4,7 +4,7 @@ ========================= import_test: format 0 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 5.3 KB + C to export, 294 entries, memory: 5.4 KB (0,7) -0.834182 (0,12) 1.26582 @@ -40,7 +40,7 @@ ========================= import_test: format 1 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 5.3 KB + C to export, 294 entries, memory: 5.4 KB (0,7) -0.834182 (0,12) 1.26582 @@ -76,7 +76,7 @@ ========================= import_test: format 2 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 5.3 KB + C to export, 294 entries, memory: 5.4 KB (0,7) -0.834182 (0,12) 1.26582 @@ -112,7 +112,7 @@ ========================= import_test: format 3 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 5.3 KB + C to export, 294 entries, memory: 5.4 KB (0,7) -0.834182 (0,12) 1.26582 @@ -150,7 +150,7 @@ ========================= import_test: format 0 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 5.3 KB + C to export, 294 entries, memory: 5.4 KB (4,0) -0.278842 (5,0) -0.268019 @@ -186,7 +186,7 @@ ========================= import_test: format 1 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 5.3 KB + C to export, 294 entries, memory: 5.4 KB (4,0) -0.278842 (5,0) -0.268019 @@ -222,7 +222,7 @@ ========================= import_test: format 2 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 5.3 KB + C to export, 294 entries, memory: 5.4 KB (4,0) -0.278842 (5,0) -0.268019 @@ -258,7 +258,7 @@ ========================= import_test: format 3 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 5.3 KB + C to export, 294 entries, memory: 5.4 KB (4,0) -0.278842 (5,0) -0.268019 diff --git a/GraphBLAS/Demo/Output/openmp_demo.out b/GraphBLAS/Demo/Output/openmp_demo.out index 7c05985184..1984601419 100644 --- a/GraphBLAS/Demo/Output/openmp_demo.out +++ b/GraphBLAS/Demo/Output/openmp_demo.out @@ -3,44 +3,49 @@ User threads in this program are OpenMP threads. ================= worker 0 starts: -================= worker 6 starts: - -================= worker 3 starts: - -================= worker 1 starts: +================= worker 4 starts: ================= worker 2 starts: -================= worker 5 starts: +================= worker 3 starts: -================= worker 4 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 4 intentional error: +----------------- worker 7 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 +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 3 intentional error: +----------------- worker 4 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 +Row index 1004 out of range; must be < 6 ------------------ worker 7 intentional error: +----------------- worker 1 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 +Row index 1001 out of range; must be < 6 ----------------- worker 2 intentional error: GraphBLAS error: GrB_INVALID_INDEX @@ -52,15 +57,10 @@ GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) Row index 1005 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 0 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101000 (0,1) 102000 @@ -93,46 +93,164 @@ Row index 1001 out of range; must be < 6 (4,4) 505000 ... ------------------ worker 1 is done: +----------------- worker 6 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + 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 + (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: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101005 (0,1) 102005 @@ -165,51 +283,46 @@ Row index 1001 out of range; must be < 6 (4,4) 505005 ... ------------------ worker 6 is done: +----------------- worker 1 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + 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 + (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 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 - ----------------- worker 7 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101007 (0,1) 102007 @@ -242,153 +355,40 @@ Row index 1001 out of range; must be < 6 (4,4) 505007 ... ------------------ 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 2 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 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 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 7 error should be same: +----------------- worker 5 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 +Row index 1005 out of range; must be < 6 ------------------ worker 5 error should be same: +----------------- worker 7 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 +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 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 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 3 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 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 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 3 error should be same: +----------------- worker 1 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 +Row index 1001 out of range; must be < 6 ---- Leader prints matrix 0 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101000 (0,1) 102000 @@ -424,7 +424,7 @@ Row index 1003 out of range; must be < 6 ---- Leader prints matrix 1 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101001 (0,1) 102001 @@ -460,7 +460,7 @@ Row index 1003 out of range; must be < 6 ---- Leader prints matrix 2 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101002 (0,1) 102002 @@ -496,7 +496,7 @@ Row index 1003 out of range; must be < 6 ---- Leader prints matrix 3 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101003 (0,1) 102003 @@ -532,7 +532,7 @@ Row index 1003 out of range; must be < 6 ---- Leader prints matrix 4 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101004 (0,1) 102004 @@ -568,7 +568,7 @@ Row index 1003 out of range; must be < 6 ---- Leader prints matrix 5 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101005 (0,1) 102005 @@ -604,7 +604,7 @@ Row index 1003 out of range; must be < 6 ---- Leader prints matrix 6 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101006 (0,1) 102006 @@ -640,7 +640,7 @@ Row index 1003 out of range; must be < 6 ---- Leader prints matrix 7 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 504 bytes + A, 36 entries, memory: 520 bytes (0,0) 101007 (0,1) 102007 diff --git a/GraphBLAS/Demo/Output/wildtype_demo.out b/GraphBLAS/Demo/Output/wildtype_demo.out index 24fc339563..c7e73afe6b 100644 --- a/GraphBLAS/Demo/Output/wildtype_demo.out +++ b/GraphBLAS/Demo/Output/wildtype_demo.out @@ -1,5 +1,5 @@ [ GxB_Type_new - 9.21e-06 sec ] + 9.48e-06 sec ] GraphBLAS type: WildType user-defined: [wildtype] size: 192 typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; WildType size: 192 @@ -11,8 +11,8 @@ a wildtype scalar: scalar1 [this is from scalar1] 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/GrB8.3.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/de/GB_jit__build__02eeeee__wildtype.o -c /home/faculty/d/davis/.SuiteSparse/GrB8.3.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/GrB8.3.0/lib/de/libGB_jit__build__02eeeee__wildtype.so /home/faculty/d/davis/.SuiteSparse/GrB8.3.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/GrB8.3.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/77/GB_jit__add__1002e0e0eee00__wildtype.o -c /home/faculty/d/davis/.SuiteSparse/GrB8.3.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/GrB8.3.0/lib/77/libGB_jit__add__1002e0e0eee00__wildtype.so /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/77/GB_jit__add__1002e0e0eee00__wildtype.o -lm -ldl -lgomp -lpthread ") (hyper to sparse) (transpose) (builder transpose) (hyper to sparse) - 0.535 sec ] +(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 ] a wildtype scalar: got scalar2 = C(7,2) [this is A(2,7)] 0.0 1.0 2.0 3.0 @@ -132,14 +132,14 @@ multiplication C=A*B InTheWild semiring: Printing the matrix with GxB_Matrix_fprint: 10x10 GraphBLAS wildtype matrix, sparse by row - input A, 3 entries, memory: 904 bytes + input A, 3 entries, memory: 920 bytes (2,4) [user-defined value] (2,7) [user-defined value] (3,7) [user-defined value] [ GrB_Matrix_nvals - 1.3e-06 sec ] + 1.11e-06 sec ] ============= printing the WildType matrix: input A (10-by-10 with 3 entries) @@ -184,7 +184,7 @@ Printing the matrix with GxB_Matrix_fprint: pending operator: implicit 2nd [ GrB_Matrix_nvals (wait:A 0 zombies, 2 pending) (build) add:(H<.>=H+H) (hyper to sparse) - 0.000289 sec ] + 0.000173 sec ] ============= printing the WildType matrix: input B (10-by-10 with 3 entries) @@ -213,8 +213,8 @@ 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/GrB8.3.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/21/GB_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult.o -c /home/faculty/d/davis/.SuiteSparse/GrB8.3.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/GrB8.3.0/lib/21/libGB_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult.so /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/21/GB_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult.o -lm -ldl -lgomp -lpthread ") - 0.963 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: 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 ] Printing the matrix with GxB_Matrix_fprint: @@ -227,7 +227,7 @@ Printing the matrix with GxB_Matrix_fprint: (3,5) [user-defined value] [ GrB_Matrix_nvals - 3.43e-07 sec ] + 5.17e-07 sec ] ============= printing the WildType matrix: output C (10-by-10 with 4 entries) @@ -270,7 +270,7 @@ a wildtype scalar: [this was multiplied] The mask matrix M: 10x10 GraphBLAS bool matrix, hypersparse by row - M, no entries, memory: 4.3 KB + M, no entries, memory: 4.4 KB iso value: 1 pending tuples: 4 max pending: 256 zombies: 0 pending tuples: @@ -281,9 +281,8 @@ The mask matrix M: 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) Not using cuda path: type size not supported -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/GrB8.3.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/0f/GB_jit__AxB_dot3__03fe100eee2eee55__wildadd_wildmult.o -c /home/faculty/d/davis/.SuiteSparse/GrB8.3.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/GrB8.3.0/lib/0f/libGB_jit__AxB_dot3__03fe100eee2eee55__wildadd_wildmult.so /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/0f/GB_jit__AxB_dot3__03fe100eee2eee55__wildadd_wildmult.o -lm -ldl -lgomp -lpthread ") - 0.563 sec ] + [ 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 ] Printing the matrix with GxB_Matrix_fprint: @@ -296,7 +295,7 @@ Printing the matrix with GxB_Matrix_fprint: (3,3) [user-defined value] [ GrB_Matrix_nvals - 3.2e-07 sec ] + 4.27e-07 sec ] ============= printing the WildType matrix: output C (10-by-10 with 4 entries) @@ -333,26 +332,24 @@ a wildtype scalar: [this was added] -13424304.0 -2565388.0 6850828.0 16267044.0 ============= that was the WildType matrix output C - [ GrB_reduce Not using cuda path: type size not supported -(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/GrB8.3.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/b7/GB_jit__reduce__03feee1__wildadd.o -c /home/faculty/d/davis/.SuiteSparse/GrB8.3.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/GrB8.3.0/lib/b7/libGB_jit__reduce__03feee1__wildadd.so /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/b7/GB_jit__reduce__03feee1__wildadd.o -lm -ldl -lgomp -lpthread ") - 0.24 sec ] + [ 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 ] a wildtype scalar: sum (first time) [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 - [ GrB_reduce Not using cuda path: type size not supported - - 1.59e-05 sec ] + [ GrB_reduce + 1.2e-05 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/GrB8.3.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/6c/GB_jit__trans_unop__0802ee0ee5__wildtype.o -c /home/faculty/d/davis/.SuiteSparse/GrB8.3.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/GrB8.3.0/lib/6c/libGB_jit__trans_unop__0802ee0ee5__wildtype.so /home/faculty/d/davis/.SuiteSparse/GrB8.3.0/c/6c/GB_jit__trans_unop__0802ee0ee5__wildtype.o -lm -ldl -lgomp -lpthread ") - 0.216 sec ] + [ 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 ] C is now stored by column, but it looks just the same to the GraphBLAS user application. The difference is opaque, in the @@ -369,7 +366,7 @@ Printing the matrix with GxB_Matrix_fprint: (3,3) [user-defined value] [ GrB_Matrix_nvals - 2.43e-07 sec ] + 5.4e-07 sec ] ============= printing the WildType matrix: output C (10-by-10 with 4 entries) @@ -410,32 +407,32 @@ a wildtype scalar: [this was added] Printing the matrix with GxB_Matrix_fprint: 10x10 GraphBLAS float matrix, hypersparse by row - D, no entries, memory: 240 bytes + D, no entries, memory: 256 bytes The matrix D is not wild enough to print. [ GrB_apply (shallow-op) - 2.92e-05 sec ] + 3.66e-05 sec ] 10x10 GraphBLAS int64_t matrix, sparse by row - E (positional i), 3 entries, memory: 352 bytes + E (positional i), 3 entries, memory: 368 bytes (2,4) 2 (2,7) 2 (3,7) 3 [ GrB_apply (shallow-op) - 1.15e-05 sec ] + 1.26e-05 sec ] 10x10 GraphBLAS int64_t matrix, sparse by row - E (positional j), 3 entries, memory: 352 bytes + E (positional j), 3 entries, memory: 368 bytes (2,4) 4 (2,7) 7 (3,7) 7 [ GrB_eWiseAdd - 6.52e-06 sec ] + 7.58e-06 sec ] This is supposed to fail, as a demo of GrB_error: GraphBLAS error: GrB_DOMAIN_MISMATCH diff --git a/GraphBLAS/Demo/Program/simple_demo.c b/GraphBLAS/Demo/Program/simple_demo.c index 4739e80c27..c562106ccb 100644 --- a/GraphBLAS/Demo/Program/simple_demo.c +++ b/GraphBLAS/Demo/Program/simple_demo.c @@ -9,7 +9,7 @@ /* A simple test that illustrates the use of simple_rand. - This test does not require ANSI C11, nor GraphBLAS. It only tests the + This test does not require C11, nor GraphBLAS. It only tests the simple_* Demo functions. The output of this test should look like the following. The random numbers should be the same. On a Mac OSX system: diff --git a/GraphBLAS/Doc/ChangeLog b/GraphBLAS/Doc/ChangeLog index 8617cffed5..b3fc67fcf3 100644 --- a/GraphBLAS/Doc/ChangeLog +++ b/GraphBLAS/Doc/ChangeLog @@ -1,3 +1,24 @@ +Jan 10, 2024: version 9.0.0 + + * GrB_get/GrB_set: new functions from the v2.1 C API. + * GrB_Type_new, GrB_UnaryOp_new, GrB_IndexUnaryOp_new: no longer macros, + since 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 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. + * historical methods: many methods are replaced by GrB_get and 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: GxB_get, GxB_set, and the methods they call, and + many more. Use GrB_get/set in place those methods, and for: + GxB_*type_name, GxB_*type, GxB_Monoid_operator, GxB_Monoid_identity, + GxB_Monoid_terminal, GxB_Semiring_add, GxB_Semiring_multiply. Use + GrB_STORAGE_ORIENTATION_HINT in place of GxB_FORMAT. + * hyper_hash: constructed only if the # of non-empty vectors in a + hypersparse matrix is large (> 1024, by default) + * minor updates to build system: *.pc files for pkgconfig + Dec 30, 2023: version 8.3.1 * major change to build system: by Markus Mützel @@ -5,6 +26,8 @@ Dec 30, 2023: version 8.3.1 Oct 7, 2023: version 8.2.1 + * (50) bug fix: remove undefined behavior in Source/GB_add.c with + Cnvec_nonempty, caught by Yves Vandreissche, Intel * (49) bug fix: GrB_mxm saxpy4 and saxpy5 had incorrectly handling of typecasting in v8.0.0 to v8.2.0 (caught by Erik Welch) * cross-compiler support: replace check_c_source_runs with _compiles, @@ -105,7 +128,7 @@ Version 7.4.1, Jan 9, 2023 Version 7.4.0, Dec 23, 2022 - * added non-va_arg methods: va_arg-based GxB_get/set methods are ANSI C11 + * added non-va_arg methods: va_arg-based 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 va_arg. The existing GxB_get/set methods are not changed. The new methods are not in the @@ -618,7 +641,7 @@ Version 3.1.2, Dec 16, 2019 B is a standard matrix with one or more empty vectors. * (14) bug fix for @GrB interface: A(58) and A(:) were conflated. * compiler port: changes to allow GraphBLAS to be compiled with older - compilers (pre ANSI C11), and Microsoft Visual Studio. + compilers (pre C11), and Microsoft Visual Studio. Version 3.1.1, Oct 21, 2019 @@ -719,7 +742,7 @@ Version 2.3.0, Feb 25, 2019 * added GxB_init: GrB_init with malloc/calloc/realloc/free redefinition * _Generic: compilers differ on _Generic(x,int:,const int:). gcc, clang, icc 18.0.0 treat int and const int the same; icc 18.0.3 treats them - as different. This is a result of an ambiguity in the ANSI C11 + as different. This is a result of an ambiguity in the C11 specification. Minor update so that the use of _Generic(...) is compatible with all compilers. * early exit: for GrB_reduce @@ -773,7 +796,7 @@ Version 2.2.0 (BETA4), Nov 28, 2018 Kronecker matrix generator * minor changes for gcc -Wall -Wpedantic -Wextra, and icc -w3: to fix or silence warnings. In a few cases, prior versions were relying on - extensions to the ANSI C11 standard in gcc, clang, xlc. The extensions + extensions to the C11 standard in gcc, clang, xlc. The extensions are widely supported but best avoided anway. Version 2.2.0 (BETA3), Nov 23, 2018 diff --git a/GraphBLAS/Doc/FUTURE.txt b/GraphBLAS/Doc/FUTURE.txt new file mode 100644 index 0000000000..7327aa3ccf --- /dev/null +++ b/GraphBLAS/Doc/FUTURE.txt @@ -0,0 +1,42 @@ +FUTURE plans For 9.0.1: and beyond: + +GraphBLAS: + + don't just check 1st line of GraphBLAS.h when deciding to unpack + the src in user cache folder. Use a crc test. + +CUDA: + + finding src + kernel source location, and name + +Future features: + + pack/unpack COO + kernel fusion + CUDA kernels + fine-grain parallelism for dot-product based mxm, mxv, vxm, + then add GxB_vxvt (outer product) and GxB_vtxv (inner product) + (or call them GxB_outerProduct and GxB_innerProduct?) + + aggregators + index binary ops + GrB_extract with GrB_Vectors instead of (GrB_Index *) arrays for I and J + + iso: set a flag with GrB_get/set to disable iso. useful if the matrix is + about to become non-iso anyway. Pagerank does: + + r = teleport (becomes iso) + r += A*x (becomes non-iso) + + apply: C = f(A), A dense, no mask or accum, C already dense: do in place + + JIT: allow a flag to be set in a type or operator to selectively control + the JIT + + JIT: requires GxB_BinaryOp_new to give the string that defines the op. + Allow use of + GrB_BinaryOp_new (...) + GrB_set (op, GxB_DEFN, "string" + also for all ops + diff --git a/GraphBLAS/Doc/GrB_get_set.tex b/GraphBLAS/Doc/GrB_get_set.tex new file mode 100644 index 0000000000..2c339aa93d --- /dev/null +++ b/GraphBLAS/Doc/GrB_get_set.tex @@ -0,0 +1,1642 @@ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\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, and GrB_IndexUnaryOp: + 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_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'& see Section~\ref{jit} \\ +\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'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 (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. \\ +\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. + +%------------------------------------------------------------------------------- +\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'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. \\ +\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. \\ +\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. + +%------------------------------------------------------------------------------- +\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_API_C_2.0.0.pdf b/GraphBLAS/Doc/GraphBLAS_API_C_2.0.0.pdf deleted file mode 100644 index 73e1d0efa6..0000000000 Binary files a/GraphBLAS/Doc/GraphBLAS_API_C_2.0.0.pdf and /dev/null differ diff --git a/GraphBLAS/Doc/GraphBLAS_API_C_v2.1.0.pdf b/GraphBLAS/Doc/GraphBLAS_API_C_v2.1.0.pdf new file mode 100644 index 0000000000..1507d38aae Binary files /dev/null and b/GraphBLAS/Doc/GraphBLAS_API_C_v2.1.0.pdf differ diff --git a/GraphBLAS/Doc/GraphBLAS_API_version.tex b/GraphBLAS/Doc/GraphBLAS_API_version.tex index 12852497bd..f25dcc8067 100644 --- a/GraphBLAS/Doc/GraphBLAS_API_version.tex +++ b/GraphBLAS/Doc/GraphBLAS_API_version.tex @@ -1,3 +1,3 @@ % GraphBLAS C API Specification version, at graphblas.org -2.0.0 -(Nov 15, 2021)% +2.1.0 +(Dec 22, 2023)% diff --git a/GraphBLAS/Doc/GraphBLAS_UserGuide.bib b/GraphBLAS/Doc/GraphBLAS_UserGuide.bib index 5e162513e2..404ad3958d 100644 --- a/GraphBLAS/Doc/GraphBLAS_UserGuide.bib +++ b/GraphBLAS/Doc/GraphBLAS_UserGuide.bib @@ -182,6 +182,7 @@ @article{Davis23 keywords = {Graph algorithms, GraphBLAS, sparse matrices} } + @book{Higham, author={Higham, N.}, title={Accuracy and Stability of Numerical Algorithms}, diff --git a/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf b/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf index 74569b96db..1721401c6c 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 dab829db52..fb9ac7521d 100644 --- a/GraphBLAS/Doc/GraphBLAS_UserGuide.tex +++ b/GraphBLAS/Doc/GraphBLAS_UserGuide.tex @@ -84,6 +84,8 @@ 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} @@ -628,7 +630,7 @@ \subsection{Typecasting} %====================================================== 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 ANSI C11 language specification states that the +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' @@ -747,16 +749,14 @@ \subsection{Notation and list of GraphBLAS operations} %======================== \newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Interfaces to MATLAB, Octave, Python, Julia, Java} %%%%%%%%%%%%%%%%%%%% +\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}. -It is fully polished, and fully tested, but does have -some limitations that will be addressed in future releases. -Two Python interfaces are now available, as is a -Julia interface. These are not part of the SuiteSparse:GraphBLAS distribution. -See the links below (see Sections \ref{python} and \ref{julia}). +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} @@ -844,6 +844,21 @@ \subsection{Julia Interface} allow inputs to a function or mexFunction to be modified, so any pending work must be finished before a matrix can be used as input. +%=============================================================================== +\subsection{Go Interface} +%=============================================================================== +\label{go} + +Pascal Costanza (Intel) has a Go interface to GraphBLAS and LAGraph: +\begin{itemize} +\item forGraphBLASGo: \url{https://github.com/intel/forGraphBLASGo}, which +is almost a complete wrapper for SuiteSparse:GraphBLAS. +Documentation is at \url{https://pkg.go.dev/github.com/intel/forGraphBLASGo}. +\item forLAGraphGo: \url{https://github.com/intel/forLAGraphGo}, which is in +progress. Documentation is at +\url{https://pkg.go.dev/github.com/intel/forLAGraphGo}. +\end{itemize} + %=============================================================================== \subsection{Java Interface} %=============================================================================== @@ -1170,7 +1185,7 @@ \subsection{{\sf GrB\_init:} initialize GraphBLAS} %============================ 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'GxB_get'; +The mode of a GraphBLAS session can be queried with \verb'GrB_get'; see Section~\ref{options} for details. %=============================================================================== @@ -1199,7 +1214,7 @@ \subsection{{\sf GrB\_getVersion:} determine the C API Version} %=============== \verb'GrB_getVersion' thus provides a run-time access of the version of the C API Specification supported by the library. -\newpage +% \newpage %=============================================================================== \subsection{{\sf GxB\_init:} initialize with alternate malloc} %================ %=============================================================================== @@ -1212,10 +1227,10 @@ \subsection{{\sf GxB\_init:} initialize with alternate malloc} %================ ( GrB_Mode mode, // blocking or non-blocking mode // pointers to memory management functions. - void * (* user_malloc_function ) (size_t), - void * (* user_calloc_function ) (size_t, size_t), - void * (* user_realloc_function ) (void *, size_t), - void (* user_free_function ) (void *) + 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} @@ -1228,16 +1243,16 @@ \subsection{{\sf GxB\_init:} initialize with alternate malloc} %================ 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_function' and \verb'user_realloc_function' are optional, and -may be \verb'NULL'. If \verb'NULL', then the \verb'user_malloc_function' is +\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. Either +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 @@ -1284,6 +1299,7 @@ \subsection{{\sf GrB\_Info:} status code returned by GraphBLAS} %=============== \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 \\ @@ -1336,10 +1352,7 @@ \subsection{{\sf GrB\_error:} get more details on the last 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. \verb'GrB_BinaryOp_new', \verb'GrB_UnaryOp_new', -and \verb'GrB_IndexUnaryOp_new' record the name the function passed to them, and -\verb'GrB_Type_new' records the name of its type parameter, and these are -printed if the user-defined types and operators are used incorrectly. Refer to +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'. @@ -1386,10 +1399,11 @@ \section{GraphBLAS Objects and their Methods} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{objects} -GraphBLAS defines ten different objects to represent matrices, vectors, +GraphBLAS defines eleven different objects to represent matrices, vectors, scalars, data types, operators (binary, unary, and index-unary), monoids, -semirings, and a {\em descriptor} object used to specify optional parameters -that modify the behavior of a GraphBLAS operation. +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 @@ -1413,6 +1427,7 @@ \section{GraphBLAS Objects and their Methods} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \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} } @@ -1467,7 +1482,7 @@ \subsection{The GraphBLAS type: {\sf GrB\_Type}} %============================== } \vspace{0.2in} -The ANSI C11 definitions of \verb'float complex' and \verb'double complex' +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. @@ -1497,8 +1512,8 @@ \subsection{The GraphBLAS type: {\sf GrB\_Type}} %============================== \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_size' & return the size of a type & \ref{type_size} \\ -\verb'GxB_Type_name' & return the name of a type & \ref{type_name} \\ +\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 @@ -1532,7 +1547,7 @@ \subsubsection{{\sf GrB\_Type\_new:} create a user-defined type} 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 ANSI C11 +\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. @@ -1624,6 +1639,19 @@ \subsubsection{{\sf GxB\_Type\_new:} create a user-defined type (with name and d 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} %------------------------------------------------------------------------------- @@ -1644,71 +1672,6 @@ \subsubsection{{\sf GrB\_Type\_wait:} wait for a type} non-blocking mode to delay its creation. Currently, SuiteSparse:GraphBLAS currently does nothing except to ensure that \verb'type' is valid. -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Type\_size:} return the size of a type} -%------------------------------------------------------------------------------- -\label{type_size} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Type_size // determine the size of the type -( - size_t *size, // the sizeof the type - GrB_Type type // type to determine the sizeof -) ; -\end{verbatim} -}\end{mdframed} - -This function acts just like \verb'sizeof(type)' in the C language. For -example \verb'GxB_Type_size (&s, GrB_INT32)' sets \verb's' to 4, the same as -\verb'sizeof(int32_t)'. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Type\_name:} return the name of a type} -%------------------------------------------------------------------------------- -\label{type_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Type_name // return the name of a GraphBLAS type -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Type type -) ; -\end{verbatim} -}\end{mdframed} - -Returns the name of a type, as a string. For built-in types, the name is -the same as the C type. For example, \verb'GxB_Type_name(type_name,GrB_FP32)' -returns the name as \verb'"float"'. The following table lists the -names of the 13 built-in types. - -\vspace{0.2in} -{\small -\begin{tabular}{ll} -\hline -Type name & GraphBLAS type \\ -\hline - \verb'"bool"' & \verb'GrB_BOOL' \\ - \verb'"int8_t"' & \verb'GrB_INT8' \\ - \verb'"int16_t"' & \verb'GrB_INT16' \\ - \verb'"int32_t"' & \verb'GrB_INT32' \\ - \verb'"int64_t"' & \verb'GrB_INT64' \\ - \verb'"uint8_t"' & \verb'GrB_UINT8' \\ - \verb'"uint16_t"' & \verb'GrB_UINT16' \\ - \verb'"uint32_t"' & \verb'GrB_UINT32' \\ - \verb'"uint64_t"' & \verb'GrB_UINT64' \\ - \verb'"float"' & \verb'GrB_FP32' \\ - \verb'"double"' & \verb'GrB_FP64' \\ - \verb'"float complex"' & \verb'GxB_FC32' \\ - \verb'"double complex"' & \verb'GxB_FC64' \\ -\hline -\end{tabular}} - \newpage %------------------------------------------------------------------------------- \subsubsection{{\sf GxB\_Type\_from\_name:} return the type from its name} @@ -1726,9 +1689,15 @@ \subsubsection{{\sf GxB\_Type\_from\_name:} return the type from its name} \end{verbatim} }\end{mdframed} -Returns the built-in type from the corresponding name of the type. For -example, \verb'GxB_Type_from_name (&type, "bool")' returns \verb'GrB_BOOL'. If -the name is from a user-defined type, the \verb'type' is returned as +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. @@ -1752,10 +1721,12 @@ \subsubsection{{\sf GxB\_Type\_from\_name:} return the type from its name} // later on, to query the type of A: size_t typesize ; - GxB_Type_size (&typesize, type) ; // works for any type + 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] ; - GxB_Matrix_type_name (atype_name, A) ; + GrB_get (A, atype_name, GrB_EL_TYPE_STRING) ; GxB_Type_from_name (&atype, atype_name) ; if (atype == NULL) { @@ -1765,7 +1736,6 @@ \subsubsection{{\sf GxB\_Type\_from\_name:} return the type from its name} else { ... this is now an error ... the type of A is unknown. } }\end{verbatim} } -\newpage %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Type\_free:} free a user-defined type} %------------------------------------------------------------------------------- @@ -1981,7 +1951,7 @@ \subsection{GraphBLAS unary operators: {\sf GrB\_UnaryOp}, $z=f(x)$} %========== User-defined positional operators cannot be defined by \verb'GrB_UnaryOp_new'. \verb'GxB_FREXPX' and \verb'GxB_FREXPE' return the mantissa and exponent, -respectively, from the ANSI C11 \verb'frexp' function. The exponent is +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 @@ -2017,8 +1987,8 @@ \subsection{GraphBLAS unary operators: {\sf GrB\_UnaryOp}, $z=f(x)$} %========== \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'GxB_UnaryOp_ztype_name' & return the name of the type of the output $z$ for $z=f(x)$ & \ref{unaryop_ztype_name} \\ -\verb'GxB_UnaryOp_xtype_name' & return the name of the type of the input $x$ for $z=f(x)$ & \ref{unaryop_xtype_name} \\ +\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} @@ -2114,6 +2084,19 @@ \subsubsection{{\sf GxB\_UnaryOp\_new:} create a named user-defined unary operat 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} @@ -2136,45 +2119,6 @@ \subsubsection{{\sf GrB\_UnaryOp\_wait:} wait for a unary operator} SuiteSparse:GraphBLAS currently does nothing except to ensure that the \verb'unaryop' is valid. -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_UnaryOp\_ztype\_name:} return the name of the type of $z$} -%------------------------------------------------------------------------------- -\label{unaryop_ztype_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_UnaryOp_ztype_name // return the type_name of z -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_UnaryOp unaryop // unary operator -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GxB_UnaryOp_ztype_name' returns the name of the \verb'ztype' of the unary -operator, which is the type of $z$ in the function $z=f(x)$. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_UnaryOp\_xtype\_name:} return the name of the type of $x$} -%------------------------------------------------------------------------------- -\label{unaryop_xtype_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_UnaryOp_xtype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_UnaryOp unaryop // unary operator -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GxB_UnaryOp_xtype_name' returns the name of the \verb'xtype' of the unary -operator, which is the type of $x$ in the function $z=f(x)$. - % \newpage %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_UnaryOp\_free:} free a user-defined unary operator} @@ -2355,7 +2299,7 @@ \subsection{GraphBLAS binary operators: {\sf GrB\_BinaryOp}, $z=f(x,y)$} %====== \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 ANSI C11 functions of the same name. The last one in the table constructs +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} @@ -2368,10 +2312,10 @@ \subsection{GraphBLAS binary operators: {\sf GrB\_BinaryOp}, $z=f(x,y)$} %====== \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$ & & ANSI C11 \verb'fmod' \\ -\verb'GxB_REMAINDER_'$F$ & $F \times F \rightarrow F$ & & ANSI C11 \verb'remainder' \\ -\verb'GxB_LDEXP_'$F$ & $F \times F \rightarrow F$ & & ANSI C11 \verb'ldexp' \\ -\verb'GxB_COPYSIGN_'$F$ & $F \times F \rightarrow F$ & & ANSI C11 \verb'copysign' \\ +\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 @@ -2515,9 +2459,8 @@ \subsection{GraphBLAS binary operators: {\sf GrB\_BinaryOp}, $z=f(x,y)$} %====== \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'GxB_BinaryOp_ztype_name' & return the type of the output $z$ for $z=f(x,y)$ & \ref{binaryop_ztype_name} \\ -\verb'GxB_BinaryOp_xtype_name' & return the type of the input $x$ for $z=f(x,y)$ & \ref{binaryop_xtype_name} \\ -\verb'GxB_BinaryOp_ytype_name' & return the type of the input $y$ for $z=f(x,y)$ & \ref{binaryop_ytype_name} \\ +\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} @@ -2612,6 +2555,20 @@ \subsubsection{{\sf GxB\_BinaryOp\_new:} create a named user-defined binary oper 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} %------------------------------------------------------------------------------- @@ -2633,67 +2590,6 @@ \subsubsection{{\sf GrB\_BinaryOp\_wait:} wait for a binary operator} SuiteSparse:GraphBLAS currently does nothing for except to ensure that the \verb'binaryop' is valid. -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_BinaryOp\_ztype\_name:} return the name of the type of $z$} -%------------------------------------------------------------------------------- -\label{binaryop_ztype_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_BinaryOp_ztype_name // return the type_name of z -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_BinaryOp binaryop // binary operator to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_BinaryOp_ztype_name' -returns name of the \verb'ztype' of the binary operator, which is the -type of $z$ in the function $z=f(x,y)$. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_BinaryOp\_xtype\_name:} return the name of the type of $x$} -%------------------------------------------------------------------------------- -\label{binaryop_xtype_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_BinaryOp_xtype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_BinaryOp binaryop // binary operator to query -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GxB_BinaryOp_xtype_name' -returns name of the \verb'xtype' of the binary operator, which is the -type of $x$ in the function $z=f(x,y)$. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_BinaryOp\_ytype\_name:} return the name of the type of $y$} -%------------------------------------------------------------------------------- -\label{binaryop_ytype_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_BinaryOp_ytype_name // return the type_name of y -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_BinaryOp binaryop // binary operator to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_BinaryOp_ytype_name' -returns name of the \verb'ytype' of the binary operator, which is the -type of $y$ in the function $z=f(x,y)$. - %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_BinaryOp\_free:} free a user-defined binary operator} %------------------------------------------------------------------------------- @@ -2796,7 +2692,7 @@ \subsection{GraphBLAS IndexUnaryOp operators: {\sf GrB\_IndexUnaryOp}} %======== 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 + const void *y // input scalar y of type ytype ) ; \end{verbatim}} The following built-in operators are available. Operators that do not depend @@ -2857,9 +2753,8 @@ \subsection{GraphBLAS IndexUnaryOp operators: {\sf GrB\_IndexUnaryOp}} %======== \verb'GrB_IndexUnaryOp_new' & create a user-defined index-unary operator & \ref{idxunop_new} \\ \verb'GxB_IndexUnaryOp_new' & create a named user-defined index-unary operator & \ref{idxunop_new_named} \\ \verb'GrB_IndexUnaryOp_wait' & wait for a user-defined index-unary operator & \ref{idxunop_wait} \\ -\verb'GrB_IndexUnaryOp_ztype_name' & return the type of the output $z$ & \ref{idxunop_ztype_name} \\ -\verb'GrB_IndexUnaryOp_xtype_name' & return the type of the input $x$ & \ref{idxunop_xtype_name} \\ -\verb'GrB_IndexUnaryOp_ytype_name' & return the type of the scalar $y$ & \ref{idxunop_ytype_name} \\ +\verb'GrB_get' & get properties of an operator & \ref{get_set_idxunop} \\ +\verb'GrB_set' & set the operator name/definition & \ref{get_set_idxunop} \\ \verb'GrB_IndexUnaryOp_free' & free a user-defined index-unary operator & \ref{idxunop_free} \\ \hline \end{tabular} @@ -2934,6 +2829,45 @@ \subsubsection{{\sf GxB\_IndexUnaryOp\_new:} create a named user-defined index-u The two strings \verb'idxop_name' and \verb'idxop_defn' are optional, but are required to enable the JIT compilation of kernels that use this operator. +The strings can also be set the \verb'GrB_set' after the operator is created +with \verb'GrB_IndexUnaryOp_new'. For example: + +{\footnotesize +\begin{verbatim} + void banded_idx + ( + bool *z, + const int64_t *x, // unused + int64_t i, + int64_t j, + const int64_t *thunk + ) + { + // d = abs (j-i) + int64_t d = j-i ; + if (d < 0) d = -d ; + (*z) = (d <= *thunk) ; + } + + #define BANDED_IDX_DEFN \ + "void banded_idx \n" \ + "( \n" \ + " bool *z, \n" \ + " const int64_t *x, // unused \n" \ + " int64_t i, \n" \ + " int64_t j, \n" \ + " const int64_t *thunk \n" \ + ") \n" \ + "{ \n" \ + " int64_t d = j-i ; \n" \ + " if (d < 0) d = -d ; \n" \ + " (*z) = (d <= *thunk) ; \n" \ + "}" + + GxB_IndexUnaryOp_new (&Banded, + (GxB_index_unary_function) banded_idx, + GrB_BOOL, GrB_INT64, GrB_INT64, + "banded_idx", BANDED_IDX_DEFN)) ;\end{verbatim}} 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'. @@ -2941,6 +2875,21 @@ \subsubsection{{\sf GxB\_IndexUnaryOp\_new:} create a named user-defined index-u 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_IndexUnaryOp_new' requires a non-NULL function pointer. +The \verb'banded_idx' function is defined the same as above. + +{\footnotesize +\begin{verbatim} + void banded_idx ... see above + #define BANDED_IDX_DEFN ... see above + + GrB_IndexUnaryOp_new (&Banded, + (GxB_index_unary_function) banded_idx, + GrB_BOOL, GrB_INT64, GrB_INT64) ; + GrB_set (Banded, "banded_idx", GxB_JIT_C_NAME)) ; + GrB_set (Banded, BANDED_IDX_DEFN, GxB_JIT_C_DEFINITION)) ;\end{verbatim}} + %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_IndexUnaryOp\_wait:} wait for an index-unary operator} %------------------------------------------------------------------------------- @@ -2963,66 +2912,6 @@ \subsubsection{{\sf GrB\_IndexUnaryOp\_wait:} wait for an index-unary operator} \verb'op' is valid. \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_IndexUnaryOp\_ztype\_name:} return the name of the type of $z$} -%------------------------------------------------------------------------------- -\label{idxunop_ztype_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_IndexUnaryOp_ztype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_IndexUnaryOp op // index-unary operator -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GrB_IndexUnaryOp_ztype_name' returns the \verb'ztype' of the index-unary -operator, which is the type of $z$ in the function $z=f(x,i,j,y)$. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_IndexUnaryOp\_xtype\_name:} return the name of the type of $x$} -%------------------------------------------------------------------------------- -\label{idxunop_xtype_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_IndexUnaryOp_xtype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_IndexUnaryOp op // index-unary operator -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GrB_IndexUnaryOp_xtype_name' returns the \verb'xtype' of the index-unary -operator, which is the type of $x$ in the function $z=f(x,i,j,y)$. -This input is used for the entry \verb'A(i,j)' of a matrix or \verb'v(i)' of a -vector. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_IndexUnaryOp\_ytype\_name:} return the name of the type of scalar $y$} -%------------------------------------------------------------------------------- -\label{idxunop_ytype_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_IndexUnaryOp_ytype_name // return the type_name of the scalar y -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_IndexUnaryOp op // index-unary operator -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GrB_IndexUnaryOp_ytype_name' returns the \verb'ytype' of the index-unary -operator, which is the type of the scalar y in the function $z=f(x,i,j,y)$. - %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_IndexUnaryOp\_free:} free a user-defined index-unary operator} %------------------------------------------------------------------------------- @@ -3168,9 +3057,8 @@ \subsection{GraphBLAS monoids: {\sf GrB\_Monoid}} %============================= \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'GxB_Monoid_operator' & return the monoid operator & \ref{monoid_operator} \\ -\verb'GxB_Monoid_identity' & return the monoid identity value & \ref{monoid_identity} \\ -\verb'GxB_Monoid_terminal' & return the monoid terminal value (if any) & \ref{monoid_terminal} \\ +\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} @@ -3299,77 +3187,6 @@ \subsubsection{{\sf GxB\_Monoid\_terminal\_new:} create a monoid with terminal} based on this user-defined operator with a terminal value of zero and an identity of \verb'+INFINITY'. -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Monoid\_operator:} return the monoid operator} -%------------------------------------------------------------------------------- -\label{monoid_operator} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Monoid_operator // return the monoid operator -( - GrB_BinaryOp *op, // returns the binary op of the monoid - GrB_Monoid monoid // monoid to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Monoid_operator' returns the binary operator of the monoid. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Monoid\_identity:} return the monoid identity} -%------------------------------------------------------------------------------- -\label{monoid_identity} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Monoid_identity // return the monoid identity -( - void *identity, // returns the identity of the monoid - GrB_Monoid monoid // monoid to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Monoid_identity' returns the identity value of the monoid. The -\verb'void *' pointer, \verb'identity', must be non-\verb'NULL' and must point -to a memory space of size at least equal to the size of the type of the -\verb'monoid'. The type size can be obtained via \verb'GxB_Monoid_operator' to -return the monoid additive operator, then \verb'GxB_BinaryOp_ztype' to obtain -the \verb'ztype', followed by \verb'GxB_Type_size' to get its size. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Monoid\_terminal:} return the monoid terminal value} -%------------------------------------------------------------------------------- -\label{monoid_terminal} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Monoid_terminal // return the monoid terminal -( - bool *has_terminal, // true if the monoid has a terminal value - void *terminal, // returns the terminal of the monoid - GrB_Monoid monoid // monoid to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Monoid_terminal' returns the terminal value of the monoid (if any). -The \verb'void *' pointer, \verb'terminal', must be non-\verb'NULL' and must -point to a memory space of size at least equal to the size of the type of the -\verb'monoid'. The type size can be obtained via \verb'GxB_Monoid_operator' to -return the monoid additive operator, then \verb'GxB_BinaryOp_ztype' to obtain -the \verb'ztype', followed by \verb'GxB_Type_size' to get its size. - -If the monoid has a terminal value, then \verb'has_terminal' is \verb'true', -and its value is returned in the \verb'terminal' parameter. If it has no -terminal value, then \verb'has_terminal' is \verb'false', and the -\verb'terminal' parameter is not modified. - % \newpage %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Monoid\_free:} free a monoid} @@ -3420,8 +3237,8 @@ \subsection{GraphBLAS semirings: {\sf GrB\_Semiring}} %========================= \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'GxB_Semiring_add' & return the additive monoid of a semiring & \ref{semiring_add} \\ -\verb'GxB_Semiring_multiply' & return the binary operator of a semiring & \ref{semiring_multiply} \\ +\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} @@ -3572,44 +3389,6 @@ \subsubsection{{\sf GrB\_Semiring\_wait:} wait for a semiring} SuiteSparse:GraphBLAS currently does nothing except to ensure that the \verb'semiring' is valid. -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Semiring\_add:} return the additive monoid of a semiring} -%------------------------------------------------------------------------------- -\label{semiring_add} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Semiring_add // return the add monoid of a semiring -( - GrB_Monoid *add, // returns add monoid of the semiring - GrB_Semiring semiring // semiring to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Semiring_add' returns the additive monoid of a semiring. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Semiring\_multiply:} return multiply operator of a semiring} -%------------------------------------------------------------------------------- -\label{semiring_multiply} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Semiring_multiply // return multiply operator of a semiring -( - GrB_BinaryOp *multiply, // returns multiply operator of the semiring - GrB_Semiring semiring // semiring to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Semiring_multiply' returns the binary multiplicative operator of a -semiring. - %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Semiring\_free:} free a semiring} %------------------------------------------------------------------------------- @@ -3657,7 +3436,8 @@ \subsection{GraphBLAS scalars: {\sf GrB\_Scalar}} %============================= \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'GxB_Scalar_type_name' & return name of the type of a scalar & \ref{scalar_type_name} \\ +\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} \\ @@ -3754,6 +3534,7 @@ \subsubsection{{\sf GrB\_Scalar\_dup:} copy a scalar} 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} @@ -3798,26 +3579,6 @@ \subsubsection{{\sf GrB\_Scalar\_nvals:} return the number of entries in a scala (short for ``number of nonzeros'') in MATLAB is better described as ``number of entries'' in GraphBLAS. -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Scalar\_type\_name:} return name of the type of a scalar} -%------------------------------------------------------------------------------- -\label{scalar_type_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Scalar_type_name // return the name of the type of a scalar -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Scalar s // GrB_Scalar to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Scalar_type_name' returns the name of the type of a scalar. -Analogous to \verb'type = class (s)' in MATLAB. - %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Scalar\_setElement:} set the single entry of a scalar} %------------------------------------------------------------------------------- @@ -3930,7 +3691,8 @@ \subsection{GraphBLAS vectors: {\sf GrB\_Vector}} %============================= \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'GxB_Vector_type_name' & name of the type of a vector & \ref{vector_type_name} \\ +\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} \\ @@ -4069,6 +3831,7 @@ \subsubsection{{\sf GrB\_Vector\_dup:} copy a vector} 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} @@ -4133,27 +3896,6 @@ \subsubsection{{\sf GrB\_Vector\_nvals:} return the number of entries 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 GxB\_Vector\_type\_name:} return name of the type of a vector} -%------------------------------------------------------------------------------- -\label{vector_type_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_type_name // return the name of the type of a vector -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Vector v // vector to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Vector_type_name' returns the name of the type of a vector. -Analogous to \verb'type = class (v)' in MATLAB. - \newpage %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Vector\_build:} build a vector from a set of tuples} @@ -4392,7 +4134,7 @@ \subsubsection{{\sf GxB\_Vector\_diag:} extract a diagonal from a matrix} $-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'GxB_Vector_Option_set' (bitmap switch and sparsity control) are +\verb'GrB_set' (bitmap switch and sparsity control) are unchanged. \newpage @@ -4480,7 +4222,8 @@ \subsection{GraphBLAS matrices: {\sf GrB\_Matrix}} %============================ \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'GxB_Matrix_type_name' & type of a matrix & \ref{matrix_type_name} \\ +\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} \\ @@ -4581,15 +4324,16 @@ \subsubsection{{\sf GrB\_Matrix\_new:} create a matrix} 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'GxB_set (GxB_FORMAT, ...)', 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. +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'GxB_set (A, GxB_FORMAT, fmt)' with \verb'fmt' equal to -\verb'GxB_BY_COL' or \verb'GxB_BY_ROW'. +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, @@ -4663,6 +4407,7 @@ \subsubsection{{\sf GrB\_Matrix\_dup:} copy a matrix} 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} @@ -4745,25 +4490,6 @@ \subsubsection{{\sf GrB\_Matrix\_nvals:} return the number of entries in MATLAB is better described as ``number of entries'' in GraphBLAS. \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_type\_name:} return name of the type of a matrix} -%------------------------------------------------------------------------------- -\label{matrix_type_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_type_name // return the name of the type of a matrix -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Matrix A // matrix to query -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Matrix_type_name' returns the name of the type of a matrix, like -\verb'type=class(A)' in MATLAB. - %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Matrix\_build:} build a matrix from a set of tuples} %------------------------------------------------------------------------------- @@ -4854,7 +4580,7 @@ \subsubsection{{\sf GrB\_Matrix\_build:} build a matrix from a set of tuples} 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 ANSI C11 to detect the type of pointer passed as 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 @@ -4935,7 +4661,7 @@ \subsubsection{{\sf GrB\_Matrix\_setElement:} add an entry to a matrix} 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 ANSI C11. For a user-defined type, \verb'x' is a \verb'void *' +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. @@ -4971,7 +4697,7 @@ \subsubsection{{\sf GrB\_Matrix\_setElement:} add an entry to a matrix} 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'GxB_Matrix_type', and of course +\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. @@ -5270,7 +4996,7 @@ \subsubsection{{\sf GxB\_Matrix\_concat:} concatenate matrices } 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'GxB_Matrix_Option_set' (format by row or by column, bitmap switch, hyper +\verb'GrB_set' (format by row or by column, bitmap switch, hyper switch, and sparsity control) are unchanged. %------------------------------------------------------------------------------- @@ -5363,7 +5089,7 @@ \subsubsection{{\sf GxB\_Matrix\_diag:} build a diagonal matrix} 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'GxB_Matrix_Option_set' (format by row or by column, bitmap switch, hyper +\verb'GrB_set' (format by row or by column, bitmap switch, hyper switch, and sparsity control) are unchanged. %------------------------------------------------------------------------------- @@ -5383,6 +5109,7 @@ \subsubsection{{\sf GxB\_Matrix\_iso:} query iso status of a matrix} Returns the true if the matrix is iso-valued, false otherwise. +\newpage %------------------------------------------------------------------------------- \subsubsection{{\sf GxB\_Matrix\_memoryUsage:} memory used by a matrix} %------------------------------------------------------------------------------- @@ -5440,9 +5167,14 @@ \subsection{Serialize/deserialize methods} 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. Currently, all versions of -SuiteSparse:GraphBLAS that implement serialization/deserialization use the same -format for the blob, so the library versions are compatible with each other. +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 @@ -5451,7 +5183,7 @@ \subsection{Serialize/deserialize methods} By default, ZSTD (level 1) compression is used for serialization, but other options can be selected via the descriptor: -\verb'GxB_set (desc, GxB_COMPRESSION, method)', where \verb'method' is an +\verb'GrB_set (desc, method, GxB_COMPRESSION)', where \verb'method' is an integer selected from the following options: \vspace{0.2in} @@ -5476,14 +5208,14 @@ \subsection{Serialize/deserialize methods} {\footnotesize \begin{verbatim} - GxB_set (desc, GxB_COMPRESSION, GxB_COMPRESSION_LZ4HC + 6) ; \end{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} - GxB_set (desc, GxB_COMPRESSION, GxB_COMPRESSION_ZSTD + 6) ; \end{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 @@ -5520,7 +5252,7 @@ \subsection{Serialize/deserialize methods} \verb'GrB_Matrix_deserialize' & deserialize a matrix & \ref{matrix_deserialize} \\ \verb'GxB_Matrix_deserialize' & deserialize a matrix & \ref{matrix_deserialize_GxB} \\ \hline -\verb'GrB_deserialize_type_name' & return the name of type of the blob & \ref{deserialize_type_name} \\ +\verb'GrB_get' & get blob properties & \ref{get_set_blob} \\ \hline \end{tabular} } @@ -5663,10 +5395,10 @@ \subsubsection{{\sf GxB\_Vector\_deserialize:} deserialize a vector} 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 ANSI C11 \verb'malloc' if \verb'GrB_init' was used +\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 ANSI C11 \verb'free' if \verb'GrB_init' was used. +the C11 \verb'free' if \verb'GrB_init' was used. %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Matrix\_serializeSize:} return size of serialized matrix} @@ -5749,10 +5481,10 @@ \subsubsection{{\sf GxB\_Matrix\_serialize:} serialize a matrix} 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 ANSI C11 \verb'malloc' if \verb'GrB_init' was used +\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 ANSI C11 \verb'free' if \verb'GrB_init' was used. +the C11 \verb'free' if \verb'GrB_init' was used. \newpage %------------------------------------------------------------------------------- @@ -5782,11 +5514,12 @@ \subsubsection{{\sf GrB\_Matrix\_deserialize:} deserialize a matrix} blob, constructed by either \verb'GrB_Matrix_serialize' or \verb'GxB_Matrix_serialize'. -\begin{alert} -{\bf SPEC:} The specification requires the \verb'type' to always be non-NULL. -As an extension, SuiteSparse:GraphBLAS allows \verb'type' to be NULL if -the blob contains a serialized matrix with a built-in type. -\end{alert} +% 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} @@ -5814,33 +5547,6 @@ \subsubsection{{\sf GxB\_Matrix\_deserialize:} deserialize a matrix} Identical to \verb'GrB_Matrix_deserialize'. -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_deserialize\_type\_name:} name of the type of a blob} -%------------------------------------------------------------------------------- -\label{deserialize_type_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_deserialize_type_name // return the type name of a blob -( - // output: - char *type_name, // name of the type (char array of size at least - // 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 -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_deserialize_type_name' returns the name of type of the matrix or -vector serialized into the blob. This method works for any blob, from -% \verb'GrB_Vector_serialize', -\verb'GxB_Vector_serialize', -\verb'GrB_Matrix_serialize', or \verb'GxB_Matrix_serialize'. - \newpage %=============================================================================== \subsection{GraphBLAS pack/unpack: using move semantics} %======== @@ -5956,7 +5662,7 @@ \subsection{GraphBLAS pack/unpack: using move semantics} %======== {\footnotesize \begin{verbatim} - GxB_set (desc, GxB_IMPORT, GxB_SECURE_IMPORT) ; \end{verbatim}} + GrB_set (desc, GxB_SECURE_IMPORT, GxB_IMPORT) ; \end{verbatim}} The table below lists the methods presented in this section. @@ -6281,7 +5987,7 @@ \subsubsection{{\sf GxB\_Matrix\_pack\_CSR:} pack a CSR matrix} \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'GxB_FORMAT') of \verb'GxB_BY_ROW'. +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. @@ -7294,8 +7000,8 @@ \subsection{GraphBLAS import/export: using copy semantics} %==================== \begin{verbatim} typedef enum { - 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) + 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}} @@ -7343,7 +7049,7 @@ \subsubsection{{\sf GrB\_Matrix\_import:} import a matrix} 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 GxB_BY_ROW) + \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. @@ -7352,7 +7058,7 @@ \subsubsection{{\sf GrB\_Matrix\_import:} import a matrix} 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 GxB_BY_COL) + \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. @@ -7369,12 +7075,12 @@ \subsubsection{{\sf GrB\_Matrix\_import:} import a matrix} 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 GxB_BY_ROW) +% \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 GxB_BY_ROW) +% \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. @@ -7470,15 +7176,15 @@ \subsubsection{{\sf GrB\_Matrix\_exportHint:} determine best export format} format of the \verb'GrB_Matrix': \begin{packed_itemize} -\item \verb'GxB_SPARSE', \verb'GxB_BY_ROW': export as \verb'GrB_CSR_FORMAT' -\item \verb'GxB_SPARSE', \verb'GxB_BY_COL': export as \verb'GrB_CSC_FORMAT' +\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'GxB_BY_ROW': export as \verb'GrB_CSR_FORMAT' -\item \verb'GxB_BITMAP', \verb'GxB_BY_COL': export as \verb'GrB_CSC_FORMAT' -%\item \verb'GxB_FULL', \verb'GxB_BY_ROW': export as \verb'GrB_DENSE_ROW_FORMAT' -%\item \verb'GxB_FULL', \verb'GxB_BY_COL': export as \verb'GrB_DENSE_COL_FORMAT' -\item \verb'GxB_FULL', \verb'GxB_BY_ROW': export as \verb'GrB_CSR_FORMAT' -\item \verb'GxB_FULL', \verb'GxB_BY_COL': export as \verb'GrB_CSC_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 @@ -7603,7 +7309,7 @@ \subsection{GraphBLAS descriptors: {\sf GrB\_Descriptor}} %===================== typedef enum { // for all GrB_Descriptor fields: - GxB_DEFAULT = 0, // default behavior of the method + 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: @@ -7708,7 +7414,7 @@ \subsection{GraphBLAS descriptors: {\sf GrB\_Descriptor}} %===================== \begin{itemize} - \item \verb'GxB_DEFAULT' means that a method is selected automatically. + \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 @@ -7769,7 +7475,7 @@ \subsection{GraphBLAS descriptors: {\sf GrB\_Descriptor}} %===================== 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'GxB_DEFAULT'). A nonzero + 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. @@ -7784,7 +7490,7 @@ \subsection{GraphBLAS descriptors: {\sf GrB\_Descriptor}} %===================== {\footnotesize \begin{verbatim} - GxB_set (desc, GxB_IMPORT, GxB_SECURE_IMPORT) ; \end{verbatim}} + GrB_set (desc, GxB_SECURE_IMPORT, GxB_IMPORT) ; \end{verbatim}} \end{itemize} @@ -7798,9 +7504,8 @@ \subsection{GraphBLAS descriptors: {\sf GrB\_Descriptor}} %===================== \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_set' & set a parameter in a descriptor & \ref{descriptor_set} \\ -\verb'GxB_Desc_set' & set a parameter in a descriptor & \ref{desc_set} \\ -\verb'GxB_Desc_get' & get a parameter from a descriptor & \ref{desc_get} \\ +\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} @@ -7847,139 +7552,6 @@ \subsubsection{{\sf GrB\_Descriptor\_wait:} wait for a descriptor} exploit non-blocking mode to delay its creation. Currently, SuiteSparse:GraphBLAS does nothing except to ensure that \verb'd' is valid. -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Descriptor\_set:} set a parameter in a descriptor} -%------------------------------------------------------------------------------- -\label{descriptor_set} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Descriptor_set // set a parameter in a descriptor -( - GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change - GrB_Desc_Value val // value to change it to -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Descriptor_set' sets a descriptor field (\verb'GrB_OUTP', -\verb'GrB_MASK', \verb'GrB_INP0', \verb'GrB_INP1', or \verb'GxB_AxB_METHOD') to -a particular value. -If an error occurs, \verb'GrB_error(&err,desc)' returns details about the error. - -\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'GxB_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'GxB_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'GxB_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'GxB_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'GrB_AxB_METHOD' - & \verb'GxB_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 -\end{tabular} -} - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Desc\_set:} set a parameter in a descriptor} -%------------------------------------------------------------------------------- -\label{desc_set} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Desc_set // set a parameter in a descriptor -( - GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change - ... // value to change it to -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Desc_set' is like \verb'GrB_Descriptor_set', except that the type of -the third parameter can vary with the field. This function can modify all -descriptor settings, including those that do not have the type -\verb'GrB_Desc_Value'. See also \verb'GxB_set' described in -Section~\ref{options}. If an error occurs, \verb'GrB_error(&err,desc)' returns -details about the error. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Desc\_get:} get a parameter from a descriptor} -%------------------------------------------------------------------------------- -\label{desc_get} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Desc_get // get a parameter from a descriptor -( - GrB_Descriptor desc, // descriptor to query; NULL means defaults - GrB_Desc_Field field, // parameter to query - ... // value of the parameter -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Desc_get' returns the value of a single field in a descriptor. The -type of the third parameter is a pointer to a variable type, whose type depends -on the field. See also \verb'GxB_get' described in Section~\ref{options}. - %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Descriptor\_free:} free a descriptor} %------------------------------------------------------------------------------- @@ -8298,8 +7870,8 @@ \section{{\sf GxB\_Context:} controlling computational resources} %============= 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'GxB_set(GxB_NTHREADS,1)' can be used (for -example). +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 @@ -8310,40 +7882,22 @@ \section{{\sf GxB\_Context:} controlling computational resources} %============= 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'GxB_set/get' methods -access this global object without naming it directly: - - \begin{itemize} - \item \verb'GxB_set (GxB_NTHREADS, nthreads)' - \item \verb'GxB_get (GxB_NTHREADS, &nthreads)' - \item \verb'GxB_set (GxB_CHUNK, chunk)' - \item \verb'GxB_get (GxB_CHUNK, &chunk)' - \end{itemize} - -Those four operations above are identical to the same set/get operations on the -the world context: - - \begin{itemize} - \item \verb'GxB_Context_set (GxB_CONTEXT_WORLD, GxB_NTHREADS, nthreads)' - \item \verb'GxB_Context_get (GxB_CONTEXT_WORLD, GxB_NTHREADS, &nthreads)' - \item \verb'GxB_Context_set (GxB_CONTEXT_WORLD, GxB_CHUNK, chunk)' - \item \verb'GxB_Context_get (GxB_CONTEXT_WORLD, GxB_CHUNK, &chunk)' - \end{itemize} - -Or, a \verb'NULL' context can be used, which also modifies the world context: +\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'GxB_Context_set (NULL, GxB_NTHREADS, nthreads)' - \item \verb'GxB_Context_get (NULL, GxB_NTHREADS, &nthreads)' - \item \verb'GxB_Context_set (NULL, GxB_CHUNK, chunk)' - \item \verb'GxB_Context_get (NULL, GxB_CHUNK, &chunk)' + \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_engate'; all subsequent calls to GraphBLAS from this +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. @@ -8368,7 +7922,7 @@ \section{{\sf GxB\_Context:} controlling computational resources} %============= // each user thread constructs its own context GxB_Context Context = NULL ; GxB_Context_new (&Context) ; - GxB_Context_set (Context, GxB_NTHREADS, ninner) ; + GrB_set (Context, ninner, GxB_NTHREADS) ; GxB_Context_engage (Context) ; // kth user thread builds kth matrix with ninner threads @@ -8403,8 +7957,8 @@ \section{{\sf GxB\_Context:} controlling computational resources} %============= GraphBLAS function & purpose & Section \\ \hline \verb'GxB_Context_new' & create a context & \ref{context_new} \\ -\verb'GxB_Context_set' & set an value in a context & \ref{context_set} \\ -\verb'GxB_Context_get' & get an value from a context & \ref{context_get} \\ +\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} \\ @@ -8429,66 +7983,10 @@ \subsection{{\sf GxB\_Context\_new:} create a new context} \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'GxB_Global_Option_get'. +\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\_set:} change a setting in a context} -%------------------------------------------------------------------------------- -\label{context_set} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Context_set // set a parameter in a context -( - GxB_Context Context // context to modify - GxB_Context_Field field, // field to modify - ... -) ; -\end{verbatim} } \end{mdframed} - -The \verb'GxB_Context_Field' parameter can currently take on one of two -values, given by the following definition: - -{\footnotesize -\begin{verbatim} -typedef enum -{ - GxB_CONTEXT_NTHREADS = GxB_NTHREADS, // max number of threads to use. - // If <= 0, then one thread is used. - GxB_CONTEXT_CHUNK = GxB_CHUNK, // chunk size for small problems. - // If < 1, then the default is used. -} -GxB_Context_Field ; -\end{verbatim} -} - -For example, \verb'GxB_set (Context, GxB_NTHREADS, 4)' sets the number of -threads in the \verb'Context' to 4. - -%------------------------------------------------------------------------------- -\subsection{{\sf GxB\_Context\_get:} get a setting from a context} -%------------------------------------------------------------------------------- -\label{context_get} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Context_get // get a parameter in a context -( - GxB_Context Context // context to query - GxB_Context_Field field, // field to query - ... -) ; -\end{verbatim} } \end{mdframed} - -For example, \verb'GxB_get (Context, GxB_NTHREADS, &nthreads)' returns the -number of threads set in the \verb'Context', returning the result in the -\verb'int32_t' scalar, \verb'nthreads'. - \newpage %------------------------------------------------------------------------------- \subsection{{\sf GxB\_Context\_engage:} engaging context} @@ -8654,8 +8152,8 @@ \subsection{Using the JIT} 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'GxB_Global_Option_set', and can be queried via -\verb'GxB_Global_Option_get'; refer to Section~\ref{options} for details, and +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} @@ -8690,14 +8188,14 @@ \subsection{Using the JIT} 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'GxB_set', compiled kernels +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'GxB_get/set' using the +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 @@ -8706,10 +8204,10 @@ \subsubsection{\sf GxB\_JIT\_C\_CONTROL} loaded JIT kernels from memory, use: \begin{verbatim} - GxB_set (GxB_JIT_C_CONTROL, GxB_JIT_OFF) ; + GrB_set (GrB_GLOBAL, GxB_JIT_OFF, GxB_JIT_C_CONTROL) ; \end{verbatim} -The above call to \verb'GxB_set' does not clear any PreJIT kernels, however, +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 @@ -8738,7 +8236,7 @@ \subsubsection{\sf GxB\_JIT\_C\_CONTROL} \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'GxB_get', if desired. +setting can be queried via \verb'GrB_get', if desired. The JIT control setting can be also changed by GraphBLAS itself, based on following error conditions. These changes affect all kernels, not just the @@ -8747,7 +8245,7 @@ \subsubsection{\sf GxB\_JIT\_C\_CONTROL} generic kernels instead. It would return \verb'GrB_OUT_OF_MEMORY' for the last case below. The error is also reported if the \verb'GxB_BURBLE' is enabled. If the JIT is disabled through any of these errors, it can be detected by -\verb'GxB_get' to read the \verb'GxB_JIT_C_CONTROL' state. +\verb'GrB_get' to read the \verb'GxB_JIT_C_CONTROL' state. \begin{itemize} @@ -8874,21 +8372,11 @@ \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 Linux or Mac, or 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. - -On Windows with MS Visual Studio, only cmake may be used, and this setting is -ignored (it is always true). Direct compilation without cmake on Windows with -MSVC is not yet available. - -When using MINGW on Windows the opposite is true: cmake may not be used, and -this setting ignored (it is always false). The only option is to use a direct -compile instead of using cmake. Using cmake to build kernels when using MINGW -on Windows is not yet available. +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 @@ -8923,1436 +8411,241 @@ \subsection{Compilation options: {\sf GRAPHBLAS\_USE\_JIT} and {\sf GRAPHBLAS\_C %------------------------------------------------------------------------------- The CPU JIT can be disabled at compile time by setting the -\verb'GRAPHBLAS_USE_NIT' option \verb'OFF' in the cmake build options. Good +\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'GRAPHBLAS_COMPACT' option in the cmake -build options. By default, \verb'GRAPHBLAS_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 RedisGraph. - -%------------------------------------------------------------------------------- -\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'GxB_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{More JIT kernels} -I have 44 JIT kernels but could write about another 43 for \verb'GrB_assign', -\verb'GrB_extract', \verb'GrB_kronecker', and other kernels. Grep the source -code for \verb'JIT: needed' for a list. The current JIT kernels cover all the -\verb'generic' kernels in SuiteSparse GraphBLAS v7.x and earlier for which {\em -factory} kernels are available. However, in those versions, some kernels are -only generic. This version does not accelerate those, but they will be -accelerated by the JIT in a future version. - -\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. - -\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 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{SuiteSparse:GraphBLAS Options} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{options} - -SuiteSparse:GraphBLAS includes two type-generic methods, \verb'GxB_set' and -\verb'GxB_get', that set and query various options and parameters settings, -including a generic way to set values in the \verb'GrB_Descriptor' object. -Using these methods, the user application can provide hints to -SuiteSparse:GraphBLAS on how it should store and operate on its matrices. -These hints have no effect on the results of any GraphBLAS operation (except -perhaps floating-point roundoff differences), but they can have a great impact -on the amount of time or memory taken. - -\begin{note} -{\bf NOTE:} In the next release, \verb'GxB_get' and \verb'GxB_set' will be -replaced by \verb'GrB_*_get' and \verb'GrB_*_set', using the v2.1 C API -Specification. -\end{note} - -%------------------------------------------------------------------------------- -\subsection{{\sf GxB\_set}: overview} -%------------------------------------------------------------------------------- - -\begin{itemize} - -\item \verb'GxB_set (field, value)' sets global options. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GxB_HYPER_SWITCH' & \verb'double' & hypersparsity control (0 to 1) \\ -\verb'GxB_BITMAP_SWITCH' & \verb'double [8]' & bitmap control \\ -\verb'GxB_FORMAT' & \verb'int' & \verb'GxB_BY_ROW' - or \verb'GxB_BY_COL' \\ -\verb'GxB_GLOBAL_NTHREADS' & \verb'int' & number of threads to use \\ -\verb'GxB_NTHREADS' & \verb'int' & number of threads to use \\ -\verb'GxB_GLOBAL_CHUNK' & \verb'double' & chunk size \\ -\verb'GxB_CHUNK' & \verb'double' & chunk size \\ -\verb'GxB_BURBLE' & \verb'int' & diagnostic output \\ -\verb'GxB_PRINTF' & see below & diagnostic output \\ -\verb'GxB_FLUSH' & see below & diagnostic output \\ -\verb'GxB_PRINT_1BASED' & \verb'int' & for printing matrices/vectors \\ -\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 \\ -\verb'GxB_JIT_C_CMAKE_LIBS' & \verb'char *' & libraries to link against \\ -\verb'GxB_JIT_C_PREFACE' & \verb'char *' & C code as preface to JIT kernels \\ -\verb'GxB_JIT_C_CONTROL' & see Section \ref{jit} & CPU JIT control \\ -\verb'GxB_JIT_USE_CMAKE' & see Section \ref{jit} & CPU JIT: use cmake \\ -\verb'GxB_JIT_ERROR_LOG' & \verb'char *' & error log file \\ -\verb'GxB_JIT_CACHE_PATH' & \verb'char *' & folder with compiled kernels \\ -\hline -\end{tabular} -} - -\item \verb'GxB_set (GrB_Matrix A, field, value)' provides hints to - SuiteSparse: GraphBLAS on how to store a particular matrix. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GxB_HYPER_SWITCH' & \verb'double' & hypersparsity control (0 to 1) \\ -\verb'GxB_BITMAP_SWITCH' & \verb'double' & bitmap control (0 to 1) \\ -\verb'GxB_FORMAT' & \verb'int' & \verb'GxB_BY_ROW' - or \verb'GxB_BY_COL' \\ -\verb'GxB_SPARSITY_CONTROL' & \verb'int' & 0 to 15 \\ -\hline -\end{tabular} -} - -\item \verb'GxB_set (GrB_Vector v, field, value)' provides hints to - SuiteSparse: GraphBLAS on how to store a particular vector. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GxB_BITMAP_SWITCH' & \verb'double' & bitmap control (0 to 1) \\ -\verb'GxB_SPARSITY_CONTROL' & \verb'int' & 0 to 15 \\ -\hline -\end{tabular} -} - -\item \verb'GxB_set (GrB_Descriptor desc, field, value)' sets - the value of a field in a \verb'GrB_Descriptor'. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GrB_OUTP' & \verb'GrB_Desc_Value' & replace option \\ -\verb'GrB_MASK' & \verb'GrB_Desc_Value' & mask option \\ -\verb'GrB_INP0' & \verb'GrB_Desc_Value' & transpose input 0 \\ -\verb'GrB_INP1' & \verb'GrB_Desc_Value' & transpose input 1 \\ -\verb'GxB_AxB_METHOD' & \verb'int' & method for matrix multiply \\ -\verb'GxB_SORT' & \verb'int' & lazy vs aggressive sort \\ -\verb'GxB_COMPRESSION' & \verb'int' & compression for serialization \\ -\verb'GxB_IMPORT' & \verb'GrB_Desc_Value' & trust data on import/pack \\ -\hline -\end{tabular} -} - -\item \verb'GxB_set (GxB_Context desc, field, value)' sets - the value of a field in a \verb'GxB_Context'. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GxB_NTHREADS' & \verb'int' & number of threads to use \\ -\verb'GxB_CHUNK' & \verb'double' & chunk size \\ -\hline -\end{tabular} -} - -\end{itemize} - -%------------------------------------------------------------------------------- -\subsection{{\sf GxB\_get}: overview} -%------------------------------------------------------------------------------- - -\verb'GxB_get' queries a \verb'GrB_Descriptor', a \verb'GrB_Matrix', -a \verb'GrB_Vector', or the global options. - -\begin{itemize} - -\item \verb'GxB_get (field, &value)' retrieves the value of a global option. -NOTE: the \verb'const char *' values returned by \verb'GxB_get' are pointers -to memory spaces ``owned'' by the GraphBLAS library. Do not modify them. -Subsequent calls to GraphBLAS (particularly setting the JIT control strings) -can change those strings. The user application must copy those strings into -its own memory space if the strings are to be kept. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GxB_HYPER_SWITCH' & \verb'double' & hypersparsity control (0 to 1) \\ -\verb'GxB_BITMAP_SWITCH' & \verb'double [8]' & bitmap control \\ -\verb'GxB_FORMAT' & \verb'int' & \verb'GxB_BY_ROW' or \verb'GxB_BY_COL' \\ -\verb'GxB_GLOBAL_NTHREADS' & \verb'int' & number of threads to use \\ -\verb'GxB_NTHREADS' & \verb'int' & number of threads to use \\ -\verb'GxB_GLOBAL_CHUNK' & \verb'double' & chunk size \\ -\verb'GxB_CHUNK' & \verb'double' & chunk size \\ -\verb'GxB_BURBLE' & \verb'int' & diagnostic output \\ -\verb'GxB_PRINTF' & see below & diagnostic output \\ -\verb'GxB_FLUSH' & see below & diagnostic output \\ -\verb'GxB_PRINT_1BASED' & \verb'int' & for printing matrices/vectors \\ -\hline -\verb'GxB_JIT_C_COMPILER_NAME' & \verb'const char *' & C compiler for JIT kernels \\ -\verb'GxB_JIT_C_COMPILER_FLAGS'& \verb'const char *' & flags for the C compiler \\ -\verb'GxB_JIT_C_LINKER_FLAGS' & \verb'const char *' & link flags for the C compiler \\ -\verb'GxB_JIT_C_LIBRARIES' & \verb'const char *' & libraries to link against \\ -\verb'GxB_JIT_C_CMAKE_LIBS' & \verb'const char *' & libraries to link against \\ -\verb'GxB_JIT_C_PREFACE' & \verb'const char *' & C code as preface to JIT kernels \\ -\verb'GxB_JIT_C_CONTROL' & see Section \ref{jit} & CPU JIT control \\ -\verb'GxB_JIT_USE_CMAKE' & see Section \ref{jit} & CPU JIT: use cmake \\ -\verb'GxB_JIT_ERROR_LOG' & \verb'const char *' & error log file \\ -\verb'GxB_JIT_CACHE_PATH' & \verb'const char *' & folder with compiled kernels \\ -\hline -\verb'GxB_MODE' & \verb'int' & blocking/non-blocking \\ -\verb'GxB_LIBRARY_NAME' & \verb'const char *' & name of library \\ -\verb'GxB_LIBRARY_VERSION' & \verb'int [3]' & library version \\ -\verb'GxB_LIBRARY_DATE' & \verb'const char *' & release date \\ -\verb'GxB_LIBRARY_ABOUT' & \verb'const char *' & about the library \\ -\verb'GxB_LIBRARY_LICENSE' & \verb'const char *' & license \\ -\verb'GxB_LIBRARY_COMPILE_DATE' & \verb'const char *' & date of compilation \\ -\verb'GxB_LIBRARY_COMPILE_TIME' & \verb'const char *' & time of compilation \\ -\verb'GxB_LIBRARY_OPENMP' & \verb'bool' & true if compiled with OpenMP\\ -\verb'GxB_LIBRARY_URL' & \verb'const char *' & url of library \\ -\verb'GxB_API_VERSION' & \verb'int [3]' & C API version \\ -\verb'GxB_API_DATE' & \verb'const char *' & C API date \\ -\verb'GxB_API_ABOUT' & \verb'const char *' & about the C API \\ -\verb'GxB_API_URL' & \verb'const char *' & \verb'http://graphblas.org' \\ -\verb'GxB_COMPILER_NAME' & \verb'const char *' & C compiler name \\ -\verb'GxB_COMPILER_VERSION' & \verb'int [3]' & C compiler version \\ -\hline -\end{tabular} -} - -\newpage -\item \verb'GxB_get (GrB_Matrix A, field, &value)' retrieves the current - value of an option from a particular matrix \verb'A'. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GxB_HYPER_SWITCH' & \verb'double' & hypersparsity control (0 to 1) \\ -\verb'GxB_BITMAP_SWITCH' & \verb'double' & bitmap control (0 to 1) \\ -\verb'GxB_FORMAT' & \verb'int' & \verb'GxB_BY_ROW' - or \verb'GxB_BY_COL' \\ -\verb'GxB_SPARSITY_CONTROL' & \verb'int' & 0 to 15 \\ -\verb'GxB_SPARSITY_STATUS' & \verb'int' & 1, 2, 4, or 8 \\ -\hline -\end{tabular} -} - -\item \verb'GxB_get (GrB_Vector A, field, &value)' retrieves the current - value of an option from a particular vector \verb'v'. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GxB_BITMAP_SWITCH' & \verb'double' & bitmap control (0 to 1) \\ -\verb'GxB_FORMAT' & \verb'int' & \verb'GxB_BY_ROW' - or \verb'GxB_BY_COL' \\ -\verb'GxB_SPARSITY_CONTROL' & \verb'int' & 0 to 15 \\ -\verb'GxB_SPARSITY_STATUS' & \verb'int' & 1, 2, 4, or 8 \\ -\hline -\end{tabular} -} - -\item \verb'GxB_get (GrB_Descriptor desc, field, &value)' retrieves the value - of a field in a descriptor. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GrB_OUTP' & \verb'GrB_Desc_Value' & replace option \\ -\verb'GrB_MASK' & \verb'GrB_Desc_Value' & mask option \\ -\verb'GrB_INP0' & \verb'GrB_Desc_Value' & transpose input 0 \\ -\verb'GrB_INP1' & \verb'GrB_Desc_Value' & transpose input 1 \\ -\verb'GxB_AxB_METHOD' & \verb'int' & method for matrix multiply \\ -\verb'GxB_SORT' & \verb'int' & lazy vs aggressive sort \\ -\verb'GxB_COMPRESSION' & \verb'int' & compression for serialization \\ -\verb'GxB_IMPORT' & \verb'GrB_Desc_Value' & trust data on import/pack \\ -\hline -\end{tabular} -} - -\item \verb'GxB_get (GxB_Context desc, field, value)' retrieves - the value of a field in a \verb'GxB_Context'. - -{\footnotesize -\begin{tabular}{lll} -field & value & description \\ -\hline -\verb'GxB_NTHREADS' & \verb'int' & number of threads to use \\ -\verb'GxB_CHUNK' & \verb'double' & chunk size \\ -\hline -\end{tabular} -} - -\end{itemize} - -%------------------------------------------------------------------------------- -\newpage -\subsection{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'GxB_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} - int nthreads_max = 40 ; - GxB_set (GxB_NTHREADS, nthreads_max) ; - GxB_set (GxB_CHUNK, (double) 20000) ; \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'GxB_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'GxB_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'GxB_set (GxB_NTHREADS, 4)' 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'-DNOPENMP=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: - -\begin{verbatim} - bool have_openmp ; - GxB_get (GxB_LIBRARY_OPENMP, &have_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). - -%------------------------------------------------------------------------------- -\subsection{Storing a matrix by row or by column} -%------------------------------------------------------------------------------- - -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: - #ifdef GxB_SUITESPARSE_GRAPHBLAS - GxB_set (GxB_FORMAT, GxB_BY_COL) ; - #endif \end{verbatim} } - -If this is done, and no other \verb'GxB_set' calls are made with -\verb'GxB_FORMAT', all matrices will be stored by column. -The default format is \verb'GxB_BY_ROW'. - -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 \verb'GxB_set (A, GxB_FORMAT, ...)'. -So 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. - -%------------------------------------------------------------------------------- -\subsection{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'GxB_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 ; - GxB_set (A, GxB_HYPER_SWITCH, 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'GxB_BY_ROW' or \verb'GxB_BY_COL' format, as determined by the last call -to \verb'GxB_set(GxB_FORMAT,...)' 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'. - -%------------------------------------------------------------------------------- -\subsection{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 } ; - GxB_set (GxB_BITMAP_SWITCH, bswitch) ; -\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. - -%------------------------------------------------------------------------------- -\subsection{Parameter types} -%------------------------------------------------------------------------------- -The \verb'GxB_Option_Field' enumerated type gives the type of the \verb'field' -parameter for the second argument of \verb'GxB_set' and \verb'GxB_get', -for setting global options or matrix options. - -NOTE: The enum values have changed with v8.0.0, to be compatible with the -future updates from the v2.1 C API specification. - -{\footnotesize -\begin{verbatim} -\end{verbatim} } - -The \verb'GxB_FORMAT' field can be by row or by column, set to a value -with the type \verb'GxB_Format_Value': - -{\footnotesize -\begin{verbatim} -typedef enum -{ - GxB_BY_ROW = 0, // CSR: compressed sparse row format - GxB_BY_COL = 1 // CSC: compressed sparse column format -} -GxB_Format_Value ; -\end{verbatim} } - -The default format is given by the predefined value \verb'GxB_FORMAT_DEFAULT', -which is equal to \verb'GxB_BY_ROW'. -The default hypersparsity -ratio is 0.0625 (1/16), but this value may change in the future. - -Setting the \verb'GxB_HYPER_SWITCH' field to \verb'GxB_ALWAYS_HYPER' ensures a matrix -always stays hypersparse. If set to \verb'GxB_NEVER_HYPER', it always stays -non-hypersparse. At startup, \verb'GrB_init' defines the following initial -settings: - -{\footnotesize -\begin{verbatim} - GxB_set (GxB_HYPER_SWITCH, GxB_HYPER_DEFAULT) ; - GxB_set (GxB_FORMAT, GxB_BY_ROW) ; -\end{verbatim} } - -That is, by default, all new matrices are held by row in CSR format (except -for \verb'n-by-1' matrices; see \verb'GrB_Matrix_new'). -If a matrix has fewer than $n/16$ -columns, it can be converted to hypersparse format. If it has more than $n/8$ -columns, it can be converted to non-hypersparse format. These options can be -changed for all future matrices with \verb'GxB_set'. For example, to change -all future matrices to be in non-hypersparse CSC when created, use: - -{\footnotesize -\begin{verbatim} - GxB_set (GxB_HYPER_SWITCH, GxB_NEVER_HYPER) ; - GxB_set (GxB_FORMAT, GxB_BY_COL) ; -\end{verbatim} } - -Then if a particular matrix needs a different format, then (as an example): - -{\footnotesize -\begin{verbatim} - GxB_set (A, GxB_HYPER_SWITCH, 0.1) ; - GxB_set (A, GxB_FORMAT, GxB_BY_ROW) ; -\end{verbatim} } - -This changes the matrix \verb'A' so that it is stored by row, and it is -converted from non-hypersparse to hypersparse format if it has fewer than 10\% -non-empty columns. If it is hypersparse, it is a candidate for conversion to -non-hypersparse if has 20\% or more non-empty columns. If it has between 10\% -and 20\% non-empty columns, it remains in its current format. -MATLAB only supports a non-hypersparse CSC format. The format in -SuiteSparse:GraphBLAS that is equivalent to the MATLAB format is: - -{\footnotesize -\begin{verbatim} - GrB_init (...) ; - GxB_set (GxB_HYPER_SWITCH, GxB_NEVER_HYPER) ; - GxB_set (GxB_FORMAT, GxB_BY_COL) ; - // no subsequent use of GxB_HYPER_SWITCH or GxB_FORMAT -\end{verbatim} } - -The \verb'GxB_HYPER_SWITCH' and \verb'GxB_FORMAT' options should be considered as -suggestions from the user application as to how SuiteSparse:GraphBLAS can -obtain the best performance for a particular application. -SuiteSparse:GraphBLAS is free to ignore any of these suggestions, both now and -in the future, and the available options and formats may be augmented in the -future. Any prior options no longer needed in future versions of -SuiteSparse:GraphBLAS will be silently ignored, so the use these options is -safe for future updates. - -The sparsity status of a matrix can be queried with the following, which -returns a value of \verb'GxB_HYPERSPARSE' \verb'GxB_SPARSE' \verb'GxB_BITMAP' -or \verb'GxB_FULL'. - -{\footnotesize -\begin{verbatim} - int sparsity ; - GxB_get (A, GxB_SPARSITY_STATUS, &sparsity) ; \end{verbatim}} - -The sparsity format of a matrix can be controlled with \verb'GxB_set', which -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'. 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} - GxB_set (A, GxB_SPARSITY_CONTROL, GxB_SPARSE + GxB_FULL) ; \end{verbatim}} - -In this case, SuiteSparse:GraphBLAS will hold the matrix in sparse format -(\verb'CSC' or \verb'CSC', depending on its \verb'GxB_FORMAT'), unless all -entries are present, in which case it will be converted to full format. - -Only the least 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} - GxB_set (A, GxB_SPARSITY_CONTROL, ~GxB_FULL) ; \end{verbatim}} - -%------------------------------------------------------------------------------- -\subsection{{\sf GxB\_BURBLE}, {\sf GxB\_PRINTF}, {\sf GxB\_FLUSH}: diagnostics} -%------------------------------------------------------------------------------- - -\verb'GxB_set (GxB_BURBLE, ...)' controls the burble setting. It can also be -controlled via \verb'GrB.burble(b)' in the MATLAB/Octave interface. - -{\footnotesize -\begin{verbatim} - GxB_set (GxB_BURBLE, true) ; // enable burble - GxB_set (GxB_BURBLE, false) ; // 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, and when -typecasting is performed, and it is 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. - -\verb'GxB_set (GxB_PRINTF, printf)' allows the user application to change the -function used to print diagnostic output. This also controls the output of the -\verb'GxB_*print' functions. By default this parameter is \verb'NULL', in -which case the ANSI C11 \verb'printf' function is used. The parameter is a -function pointer with the same signature as the ANSI 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 -\verb'GxB_set (GxB_FLUSH, flush)'. 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 ANSI C11 \verb'fflush' function, -except that \verb'flush' has no inputs). - -%------------------------------------------------------------------------------- -\subsection{Other global options} -%------------------------------------------------------------------------------- - -\verb'GxB_MODE' can only be -queried by \verb'GxB_get'; it cannot be modified by \verb'GxB_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'GxB_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'GxB_LIBRARY_*' options can be used with \verb'GxB_get' to query the -current implementation. For all of these, \verb'GxB_get' returns a string -(\verb'char *'), except for \verb'GxB_LIBRARY_VERSION', which takes as input an -\verb'int' array of size three. The \verb'GxB_API_*' options can be used with -\verb'GxB_get' to query the current GraphBLAS C API Specification. For all of -these, \verb'GxB_get' returns a string (\verb'char *'), except for -\verb'GxB_API_VERSION', which takes as input an \verb'int' array of size three. - -%=============================================================================== -\subsection{{\sf GxB\_Global\_Option\_set:} set a global option} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_set // set a global default option -( - const GxB_Option_Field field, // option to change - ... // value to change it to -) ; -\end{verbatim} } \end{mdframed} - -This usage of \verb'GxB_set' sets the value of a global option. -The \verb'field' parameter can be -\verb'GxB_HYPER_SWITCH', -\verb'GxB_BITMAP_SWITCH', -\verb'GxB_FORMAT', -\verb'GxB_NTHREADS', -\verb'GxB_CHUNK', -\verb'GxB_BURBLE', -\verb'GxB_PRINTF', -\verb'GxB_FLUSH', -\verb'GxB_PRINT_1BASED', \newline -\verb'GxB_JIT_C_COMPILER_NAME', -\verb'GxB_JIT_C_COMPILER_FLAGS', -\verb'GxB_JIT_C_LINKER_FLAGS', -\verb'GxB_JIT_C_LIBRRIES', -\verb'GxB_JIT_C_PREFACE', -\verb'GxB_JIT_C_CONTROL', -\verb'GxB_JIT_USE_CMAKE', -\verb'GxB_JIT_ERROR_LOG', or -\verb'GxB_JIT_CACHE_PATH'. - -For example, the following usage sets the global hypersparsity ratio to 0.2, -the format of future matrices to \verb'GxB_BY_COL', the maximum number -of threads to 4, the chunk size to 10000, and enables the burble. -No existing matrices are changed. - -{\footnotesize -\begin{verbatim} - GxB_set (GxB_HYPER_SWITCH, 0.2) ; - GxB_set (GxB_FORMAT, GxB_BY_COL) ; - GxB_set (GxB_NTHREADS, 4) ; - GxB_set (GxB_CHUNK, (double) 10000) ; - GxB_set (GxB_BURBLE, true) ; - GxB_set (GxB_PRINTF, mexPrintf) ; -\end{verbatim} } - -\newpage -%=============================================================================== -\subsection{{\sf GxB\_Matrix\_Option\_set:} set a matrix option} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_set // set an option in a matrix -( - GrB_Matrix A, // matrix to modify - const GxB_Option_Field field, // option to change - ... // value to change it to -) ; -\end{verbatim} } \end{mdframed} - -This usage of \verb'GxB_set' sets the value of a matrix option, for a -particular matrix. -The \verb'field' parameter can be -\verb'GxB_HYPER_SWITCH', -\verb'GxB_BITMAP_SWITCH', -\verb'GxB_SPARSITY_CONTROL', or -\verb'GxB_FORMAT'. -This example usage sets the hypersparsity ratio to 0.2, and the -format of \verb'GxB_BY_COL', for a particular matrix \verb'A', and sets the -sparsity control to \verb'GxB_SPARSE+GxB_FULL' (allowing the matrix to be held -in CSC or FullC formats, but not BitmapC or HyperCSC): - -{\footnotesize -\begin{verbatim} - GxB_set (A, GxB_HYPER_SWITCH, 0.2) ; - GxB_set (A, GxB_FORMAT, GxB_BY_COL) ; - GxB_set (A, GxB_SPARSITY_CONTROL, GxB_SPARSE + GxB_FULL) ; -\end{verbatim} } - -SuiteSparse:GraphBLAS currently applies these changes immediately, but since -they are simply hints, future versions of SuiteSparse:GraphBLAS may delay the -change in format if it can obtain better performance. If the setting is just -\verb'GxB_FULL' and some entries are missing, then the matrix is held in bitmap -format. For best performance, the matrix option should be set as soon as it is -created with \verb'GrB_Matrix_new', so the internal transformation takes less -time. If an error occurs, \verb'GrB_error(&err,A)' returns details about the -error. - -%=============================================================================== -\subsection{{\sf GxB\_Desc\_set:} set a {\sf GrB\_Descriptor} value} -%=============================================================================== -\label{gxbset} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_set // set a parameter in a descriptor -( - GrB_Descriptor desc, // descriptor to modify - const GrB_Desc_Field field, // parameter to change - ... // value to change it to -) ; -\end{verbatim} } \end{mdframed} - -This usage is similar to \verb'GrB_Descriptor_set', just with a name that is -consistent with the other usages of this generic function. Unlike -\verb'GrB_Descriptor_set', the \verb'field' may also be -\verb'GxB_SORT', \verb'GxB_COMPRESSION', or -\verb'GxB_IMPORT'. Refer to Sections~\ref{descriptor_set}~and~\ref{desc_set} -for details. If an error occurs, \verb'GrB_error(&err,desc)' returns details -about the error. - -\newpage -%=============================================================================== -\subsection{{\sf GxB\_Global\_Option\_get:} retrieve a global option} -%=============================================================================== -\label{gxbget} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_get // gets the current global default option -( - const GxB_Option_Field field, // option to query - ... // return value of the global option -) ; -\end{verbatim} } \end{mdframed} - -This usage of \verb'GxB_get' retrieves the value of a global option. The -\verb'field' parameter can be one of the following: +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'. -\vspace{0.2in} -{\footnotesize -\begin{tabular}{ll} - \hline - \verb'GxB_HYPER_SWITCH' & sparse/hyper setting \\ - \verb'GxB_BITMAP_SWITCH' & bitmap/sparse setting \\ - \verb'GxB_FORMAT' & by row/col setting \\ - \verb'GxB_MODE' & blocking / non-blocking \\ - \verb'GxB_NTHREADS' & default number of threads \\ - \verb'GxB_CHUNK' & default chunk size \\ - \verb'GxB_BURBLE' & burble setting \\ - \verb'GxB_PRINTF' & printf function \\ - \verb'GxB_FLUSH' & flush function \\ - \verb'GxB_PRINT_1BASED' & for printing matrices/vectors \\ - \hline - \verb'GxB_JIT_C_COMPILER_NAME' & C compiler for JIT kernels \\ - \verb'GxB_JIT_C_COMPILER_FLAGS' & flags for the C compiler \\ - \verb'GxB_JIT_C_LINKER_FLAGS' & link flags for the C compiler \\ - \verb'GxB_JIT_C_LIBRARIES' & libraries to link against \\ - \verb'GxB_JIT_C_CMAKE_LIBS' & libraries to link against \\ - \verb'GxB_JIT_C_PREFACE' & preface for JIT kernels \\ - \verb'GxB_JIT_C_CONTROL' & CPU JIT control \\ - \verb'GxB_JIT_USE_CMAKE' & CPU JIT: use cmake or not \\ - \verb'GxB_JIT_ERROR_LOG' & error log file \\ - \verb'GxB_JIT_CACHE_PATH' & folder with compiled kernels \\ - \hline - \verb'GxB_LIBRARY_NAME' & the string - \verb'"SuiteSparse:GraphBLAS"' \\ - \verb'GxB_LIBRARY_VERSION' & \verb'int' array of size 3 \\ - \verb'GxB_LIBRARY_DATE' & date of release \\ - \verb'GxB_LIBRARY_ABOUT' & author, copyright \\ - \verb'GxB_LIBRARY_LICENSE' & license for the library \\ - \verb'GxB_LIBRARY_COMPILE_DATE' & date of compilation \\ - \verb'GxB_LIBRARY_COMPILE_TIME' & time of compilation \\ - \verb'GxB_LIBRARY_OPENMP' & library compiled with OpenMP\\ - \verb'GxB_LIBRARY_URL' & URL of the library \\ - \hline - \verb'GxB_API_VERSION' & GraphBLAS C API Specification Version \\ - \verb'GxB_API_DATE' & date of the C API Spec. \\ - \verb'GxB_API_ABOUT' & about of the C API Spec. \\ - \verb'GxB_API_URL' & URL of the specification \\ - \hline -\end{tabular} -} -\vspace{0.2in} +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}. -{\bf NOTE:} The strings returned by \verb'GxB_get' are \verb'const char *'. -They are ``owned'' by the GraphBLAS library itself, not by the user -application. They cannot be freed or modified in any way. A subsequent call -to \verb'GxB_set' can free them and reallocate them, so they are only valid -until that point. If you want to keep a string returned by \verb'GxB_get', -make a copy immediately after calling \verb'GxB_get', into a character array -owned by the user application. The \verb'GxB_JIT_*' strings are the only ones -this affects. +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. -Below is an example: +%------------------------------------------------------------------------------- +\subsection{Adding {\sf PreJIT} kernels to GraphBLAS} +%------------------------------------------------------------------------------- +\label{prejit} -{\footnotesize -\begin{verbatim} - double h ; - GxB_get (GxB_HYPER_SWITCH, &h) ; - printf ("hyper_switch = %g for all new matrices\n", h) ; +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. - double b [GxB_BITMAP_SWITCH] ; - GxB_get (GxB_BITMAP_SWITCH, b) ; - for (int k = 0 ; k < GxB_NBITMAP_SWITCH ; k++) - { - printf ("bitmap_switch [%d] = %g ", k, b [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) ; - } - } +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. - GxB_Format_Value s ; - GxB_get (GxB_FORMAT, &s) ; - if (s == GxB_BY_COL) printf ("all new matrices are stored by column\n") ; - else printf ("all new matrices are stored by row\n") ; +{\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. - GrB_mode mode ; - GxB_get (GxB_MODE, &mode) ; - if (mode == GrB_BLOCKING) printf ("GrB_init(GrB_BLOCKING) was called.\n") ; - else printf ("GrB_init(GrB_NONBLOCKING) was called.\n") ; +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. - int nthreads_max ; - GxB_get (GxB_NTHREADS, &nthreads_max) ; - printf ("max # of threads to use: %d\n", nthreads_max) ; +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. - double chunk ; - GxB_get (GxB_CHUNK, &chunk) ; - printf ("chunk size: %g\n", chunk) ; +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. - char *name ; - int ver [3] ; - GxB_get (GxB_LIBRARY_NAME, &name) ; - GxB_get (GxB_LIBRARY_VERSION, ver) ; - printf ("Library %s, version %d.%d.%d\n", name, ver [0], ver [1], ver [2]) ; \end{verbatim} } +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. -%=============================================================================== -\subsection{{\sf GxB\_Matrix\_Option\_get:} retrieve a matrix option} -%=============================================================================== +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. -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_get // gets the current option of a matrix -( - GrB_Matrix A, // matrix to query - GxB_Option_Field field, // option to query - ... // return value of the matrix option -) ; -\end{verbatim} } \end{mdframed} +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. -This usage of \verb'GxB_get' retrieves the value of a matrix option. The -\verb'field' parameter can be -\verb'GxB_HYPER_SWITCH', -\verb'GxB_BITMAP_SWITCH', -\verb'GxB_SPARSITY_CONTROL', -\verb'GxB_SPARSITY_STATUS', -or -\verb'GxB_FORMAT'. -For example: +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. -\vspace{-0.1in} -{\footnotesize -\begin{verbatim} - double h, b ; - int sparsity, scontrol ; - GxB_get (A, GxB_SPARSITY_STATUS, &sparsity) ; - GxB_get (A, GxB_HYPER_SWITCH, &h) ; - printf ("matrix A has hyper_switch = %g\n", h) ; - GxB_get (A, GxB_BITMAP_SWITCH, &b) ; - printf ("matrix A has bitmap_switch = %g\n", b) ; - switch (sparsity) - { - case GxB_HYPERSPARSE: printf ("matrix A is hypersparse\n") ; break ; - case GxB_SPARSE: printf ("matrix A is sparse\n" ) ; break ; - case GxB_BITMAP: printf ("matrix A is bitmap\n" ) ; break ; - case GxB_FULL: printf ("matrix A is full\n" ) ; break ; - } - GxB_Format_Value s ; - GxB_get (A, GxB_FORMAT, &s) ; - printf ("matrix A is stored by %s\n", (s == GxB_BY_COL) ? "col" : "row") ; - GxB_get (A, GxB_SPARSITY_CONTROL, &scontrol) ; - if (scontrol & GxB_HYPERSPARSE) printf ("A may become hypersparse\n") ; - if (scontrol & GxB_SPARSE ) printf ("A may become sparse\n") ; - if (scontrol & GxB_BITMAP ) printf ("A may become bitmap\n") ; - if (scontrol & GxB_FULL ) printf ("A may become full\n") ; \end{verbatim} } +%------------------------------------------------------------------------------- +\subsection{{\sf JIT} and {\sf PreJIT} performance considerations} +%------------------------------------------------------------------------------- +\label{jit_performance} -%=============================================================================== -\subsection{{\sf GxB\_Desc\_get:} retrieve a {\sf GrB\_Descriptor} value} -%=============================================================================== +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. -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_get // get a parameter from a descriptor -( - GrB_Descriptor desc, // descriptor to query; NULL means defaults - GrB_Desc_Field field, // parameter to query - ... // value of the parameter -) ; -\end{verbatim} } \end{mdframed} +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'. -This usage is the same as \verb'GxB_Desc_get'. The \verb'field' parameter can -be \verb'GrB_OUTP', \verb'GrB_MASK', \verb'GrB_INP0', \verb'GrB_INP1', -\verb'GxB_AxB_METHOD', -\verb'GxB_SORT', -\verb'GxB_COMPRESSION', or -\verb'GxB_IMPORT'. -Refer to Section~\ref{desc_get} for details. +%------------------------------------------------------------------------------- +\subsection{Mixing JIT kernels: MATLAB and Apple Silicon} +%------------------------------------------------------------------------------- -%=============================================================================== -\subsection{Summary of usage of {\sf GxB\_set} and {\sf GxB\_get}} -%=============================================================================== +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. -The different usages of \verb'GxB_set' and \verb'GxB_get' are summarized below. +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. -\noindent -To set/get the global options: +%------------------------------------------------------------------------------- +\subsection{Updating the JIT when GraphBLAS source code changes} +%------------------------------------------------------------------------------- - {\footnotesize - \begin{verbatim} - GxB_set (GxB_HYPER_SWITCH, double h) ; - GxB_set (GxB_HYPER_SWITCH, GxB_ALWAYS_HYPER) ; - GxB_set (GxB_HYPER_SWITCH, GxB_NEVER_HYPER) ; - GxB_get (GxB_HYPER_SWITCH, double *h) ; - double b [GxB_NBITMAP_SWITCH] ; - GxB_set (GxB_BITMAP_SWITCH, b) ; - GxB_set (GxB_BITMAP_SWITCH, NULL) ; // set defaults - GxB_get (GxB_BITMAP_SWITCH, b) ; - GxB_set (GxB_FORMAT, GxB_BY_ROW) ; - GxB_set (GxB_FORMAT, GxB_BY_COL) ; - GxB_get (GxB_FORMAT, GxB_Format_Value *s) ; - GxB_set (GxB_NTHREADS, int nthreads_max) ; - GxB_get (GxB_NTHREADS, int *nthreads_max) ; - GxB_set (GxB_CHUNK, double chunk) ; - GxB_get (GxB_CHUNK, double *chunk) ; - GxB_set (GxB_BURBLE, bool burble) ; - GxB_get (GxB_BURBLE, bool *burble) ; - GxB_set (GxB_PRINTF, void *printf_function) ; - GxB_get (GxB_PRINTF, void **printf_function) ; - GxB_set (GxB_FLUSH, void *flush_function) ; - GxB_get (GxB_FLUSH, void **flush_function) ; - GxB_set (GxB_PRINT_1BASED, bool onebased) ; - GxB_get (GxB_PRINT_1BASED, bool *onebased) ; - - GxB_set (GxB_JIT_C_COMPILER_NAME, char *compiler) ; - GxB_get (GxB_JIT_C_COMPILER_NAME, char **compiler) ; - GxB_set (GxB_JIT_C_COMPILER_FLAGS, char *flags) ; - GxB_get (GxB_JIT_C_COMPILER_FLAGS, char **flags) ; - GxB_set (GxB_JIT_C_LINKER_FLAGS, char *flags) ; - GxB_get (GxB_JIT_C_LINKER_FLAGS, char **flags) ; - GxB_set (GxB_JIT_C_LIBRARIES, char *libraries) ; - GxB_get (GxB_JIT_C_LIBRARIES, char **libraries) ; - GxB_set (GxB_JIT_C_CMAKE_LIBS, char *libraries) ; - GxB_get (GxB_JIT_C_CMAKE_LIBS, char **libraries) ; - GxB_set (GxB_JIT_C_PREFACE, char *preface) ; - GxB_get (GxB_JIT_C_PREFACE, char **preface) ; - GxB_set (GxB_JIT_ERROR_LOG, char *error_log) ; - GxB_get (GxB_JIT_ERROR_LOG, char **error_log) ; - GxB_set (GxB_JIT_CACHE_PATH, char *cache) ; - GxB_get (GxB_JIT_CACHE_PATH, char **cache) ; - GxB_set (GxB_JIT_USE_CMAKE, int use_cmake) ; - GxB_get (GxB_JIT_USE_CMAKE, int *use_cmake) ; - GxB_set (GxB_JIT_C_CONTROL, int control) ; - GxB_get (GxB_JIT_C_CONTROL, int *control) ; - \end{verbatim} } +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. -\noindent -To get global options that can be queried but not modified: +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. - {\footnotesize - \begin{verbatim} - GxB_get (GxB_MODE, GrB_Mode *mode) ; - GxB_get (GxB_LIBRARY_NAME, char **) ; - GxB_get (GxB_LIBRARY_VERSION, int *) ; - GxB_get (GxB_LIBRARY_DATE, char **) ; - GxB_get (GxB_LIBRARY_ABOUT, char **) ; - GxB_get (GxB_LIBRARY_LICENSE, char **) ; - GxB_get (GxB_LIBRARY_COMPILE_DATE, char **) ; - GxB_get (GxB_LIBRARY_COMPILE_TIME, char **) ; - GxB_get (GxB_LIBRARY_OPENMP, bool *) ; - GxB_get (GxB_LIBRARY_URL, char **) ; - GxB_get (GxB_API_VERSION, int *) ; - GxB_get (GxB_API_DATE, char **) ; - GxB_get (GxB_API_ABOUT, char **) ; - GxB_get (GxB_API_URL, char **) ; \end{verbatim} } +%------------------------------------------------------------------------------- +\subsection{Future plans for the {\sf JIT} and {\sf PreJIT}} +%------------------------------------------------------------------------------- +\label{jit_future} -\noindent -To set/get a matrix option or status +\subsubsection{More JIT kernels} +I have 44 JIT kernels but could write about another 43 for \verb'GrB_assign', +\verb'GrB_extract', \verb'GrB_kronecker', and other kernels. Grep the source +code for \verb'JIT: needed' for a list. The current JIT kernels cover all the +\verb'generic' kernels in SuiteSparse GraphBLAS v7.x and earlier for which {\em +factory} kernels are available. However, in those versions, some kernels are +only generic. This version does not accelerate those, but they will be +accelerated by the JIT in a future version. - {\footnotesize - \begin{verbatim} - GxB_set (GrB_Matrix A, GxB_HYPER_SWITCH, double h) ; - GxB_set (GrB_Matrix A, GxB_HYPER_SWITCH, GxB_ALWAYS_HYPER) ; - GxB_set (GrB_Matrix A, GxB_HYPER_SWITCH, GxB_NEVER_HYPER) ; - GxB_get (GrB_Matrix A, GxB_HYPER_SWITCH, double *h) ; - GxB_set (GrB_Matrix A, GxB_BITMAP_SWITCH, double b) ; - GxB_get (GrB_Matrix A, GxB_BITMAP_SWITCH, double *b) ; - GxB_set (GrB_Matrix A, GxB_FORMAT, GxB_BY_ROW) ; - GxB_set (GrB_Matrix A, GxB_FORMAT, GxB_BY_COL) ; - GxB_get (GrB_Matrix A, GxB_FORMAT, GxB_Format_Value *s) ; - GxB_set (GrB_Matrix A, GxB_SPARSITY_CONTROL, GxB_AUTO_SPARSITY) ; - GxB_set (GrB_Matrix A, GxB_SPARSITY_CONTROL, scontrol) ; - GxB_get (GrB_Matrix A, GxB_SPARSITY_CONTROL, int *scontrol) ; - GxB_get (GrB_Matrix A, GxB_SPARSITY_STATUS, int *sparsity) ; \end{verbatim} } +\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. -\noindent -To set/get a vector option or status: +\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. - {\footnotesize - \begin{verbatim} - GxB_set (GrB_Vector v, GxB_BITMAP_SWITCH, double b) ; - GxB_get (GrB_Vector v, GxB_BITMAP_SWITCH, double *b) ; - GxB_set (GrB_Vector v, GxB_FORMAT, GxB_BY_ROW) ; - GxB_set (GrB_Vector v, GxB_FORMAT, GxB_BY_COL) ; - GxB_get (GrB_Vector v, GxB_FORMAT, GxB_Format_Value *s) ; - GxB_set (GrB_Vector v, GxB_SPARSITY_CONTROL, GxB_AUTO_SPARSITY) ; - GxB_set (GrB_Vector v, GxB_SPARSITY_CONTROL, scontrol) ; - GxB_get (GrB_Vector v, GxB_SPARSITY_CONTROL, int *scontrol) ; - GxB_get (GrB_Vector v, GxB_SPARSITY_STATUS, int *sparsity) ; \end{verbatim} } +\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. -\noindent -To set/get a descriptor field: +\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}). - {\footnotesize - \begin{verbatim} - GxB_set (GrB_Descriptor d, GrB_OUTP, GxB_DEFAULT) ; - GxB_set (GrB_Descriptor d, GrB_OUTP, GrB_REPLACE) ; - GxB_get (GrB_Descriptor d, GrB_OUTP, GrB_Desc_Value *v) ; - GxB_set (GrB_Descriptor d, GrB_MASK, GxB_DEFAULT) ; - GxB_set (GrB_Descriptor d, GrB_MASK, GrB_COMP) ; - GxB_set (GrB_Descriptor d, GrB_MASK, GrB_STRUCTURE) ; - GxB_set (GrB_Descriptor d, GrB_MASK, GrB_COMP+GrB_STRUCTURE) ; - GxB_get (GrB_Descriptor d, GrB_MASK, GrB_Desc_Value *v) ; - GxB_set (GrB_Descriptor d, GrB_INP0, GxB_DEFAULT) ; - GxB_set (GrB_Descriptor d, GrB_INP0, GrB_TRAN) ; - GxB_get (GrB_Descriptor d, GrB_INP0, GrB_Desc_Value *v) ; - GxB_set (GrB_Descriptor d, GrB_INP1, GxB_DEFAULT) ; - GxB_set (GrB_Descriptor d, GrB_INP1, GrB_TRAN) ; - GxB_get (GrB_Descriptor d, GrB_INP1, GrB_Desc_Value *v) ; - GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_DEFAULT) ; - GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_GUSTAVSON) ; - GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_HASH) ; - GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_SAXPY) ; - GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_DOT) ; - GxB_get (GrB_Descriptor d, GrB_AxB_METHOD, GrB_Desc_Value *v) ; - GxB_set (GrB_Descriptor d, GxB_SORT, sort) ; - GxB_get (GrB_Descriptor d, GxB_SORT, int *sort) ; - GxB_set (GrB_Descriptor d, GxB_COMPRESSION, GxB_FAST_IMPORT) ; - GxB_set (GrB_Descriptor d, GxB_COMPRESSION, GxB_SECURE_IMPORT) ; - GxB_get (GrB_Descriptor d, GxB_COMPRESSION, GrB_Desc_Value *method) ; - GxB_set (GrB_Descriptor d, GxB_IMPORT, int method) ; - GxB_get (GrB_Descriptor d, GxB_IMPORT, int *method) ; \end{verbatim} } +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input{GrB_get_set.tex} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -10708,7 +9001,7 @@ \subsection{{\sf GrB\_mxm:} matrix-matrix multiply} %=========================== function \verb'GB_spec_accum_mask.m', discussed in Section~\ref{accummask}. \paragraph{\bf Performance considerations:} -Suppose all matrices are in \verb'GxB_BY_COL' format, and \verb'B' is extremely +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 @@ -10768,11 +9061,11 @@ \subsection{{\sf GrB\_vxm:} vector-matrix multiply} %=========================== terms are column vectors instead of matrices. \paragraph{\bf Performance considerations:} % u'=u'*A -If the \verb'GxB_FORMAT' of \verb'A' is \verb'GxB_BY_ROW', and the default +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'GxB_FORMAT' of \verb'A' is \verb'GxB_BY_COL', then +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 @@ -10821,11 +9114,11 @@ \subsection{{\sf GrB\_mxv:} matrix-vector multiply} %=========================== \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'GxB_BY_COL'. When +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'GxB_BY_COL' format. If an application needs to perform \verb"A'*u" -repeatedly where \verb'u' is very sparse, then use the \verb'GxB_BY_ROW' format +\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 @@ -11354,9 +9647,9 @@ \subsubsection{{\sf GrB\_Matrix\_extract:} extract submatrix from matrix} \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'GxB_BY_ROW'; if +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'GxB_BY_COL'. The opposite is true if \verb'A' is transposed. +\verb'GrB_COLMAJOR'. The opposite is true if \verb'A' is transposed. \newpage %------------------------------------------------------------------------------- @@ -11396,7 +9689,7 @@ \subsubsection{{\sf GrB\_Col\_extract:} extract column vector from matrix} \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'GxB_BY_COL'. The opposite is true if \verb'A' is transposed. +\verb'GrB_COLMAJOR'. The opposite is true if \verb'A' is transposed. \newpage %=============================================================================== @@ -11564,8 +9857,8 @@ \subsubsection{{\sf GxB\_Matrix\_subassign:} assign to a 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'GxB_BY_ROW'; if \verb'|J|' is small, then it is -fastest if the format of \verb'C' is \verb'GxB_BY_COL'. The opposite is true +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 @@ -11601,9 +9894,9 @@ \subsubsection{{\sf GxB\_Col\_subassign:} assign to a sub-column of a matrix} \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'GxB_BY_COL'. \verb'GxB_Row_subassign' is much +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'GxB_BY_ROW'. +\verb'GrB_ROWMAJOR'. % \newpage %------------------------------------------------------------------------------- @@ -11638,9 +9931,9 @@ \subsubsection{{\sf GxB\_Row\_subassign:} assign to a sub-row of a matrix} \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'GxB_BY_COL'. \verb'GxB_Row_subassign' is much +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'GxB_BY_ROW'. +\verb'GrB_ROWMAJOR'. % \newpage %------------------------------------------------------------------------------- @@ -11708,7 +10001,7 @@ \subsubsection{{\sf GxB\_Matrix\_subassign\_$<$type$>$:} assign a scalar to a su 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 ANSI C11. For a user-defined type, \verb'x' is a +\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' @@ -11724,8 +10017,8 @@ \subsubsection{{\sf GxB\_Matrix\_subassign\_$<$type$>$:} assign a scalar to a su \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'GxB_BY_ROW'; if \verb'|J|' is small, then it is -fastest if the format of \verb'C' is \verb'GxB_BY_COL'. The opposite is true +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 @@ -11833,8 +10126,8 @@ \subsubsection{{\sf GrB\_Matrix\_assign:} assign to a 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'GxB_BY_ROW'; if \verb'|J|' is small, then it is -fastest if the format of \verb'C' is \verb'GxB_BY_COL'. The opposite is true +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 @@ -11872,8 +10165,8 @@ \subsubsection{{\sf GrB\_Col\_assign:} assign to a sub-column of a matrix} \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'GxB_BY_COL'. \verb'GrB_Row_assign' is much faster than -\verb'GrB_Col_assign' if the format of \verb'C' is \verb'GxB_BY_ROW'. +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 %------------------------------------------------------------------------------- @@ -11910,8 +10203,8 @@ \subsubsection{{\sf GrB\_Row\_assign:} assign to a sub-row of a matrix} \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'GxB_BY_COL'. \verb'GrB_Row_assign' is much faster than -\verb'GrB_Col_assign' if the format of \verb'C' is \verb'GxB_BY_ROW'. +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 %------------------------------------------------------------------------------- @@ -11986,7 +10279,7 @@ \subsubsection{{\sf GrB\_Matrix\_assign\_$<$type$>$:} assign a scalar to a subma 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 ANSI C11. For a user-defined type, \verb'x' is a +\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' @@ -12007,8 +10300,8 @@ \subsubsection{{\sf GrB\_Matrix\_assign\_$<$type$>$:} assign a scalar to a subma \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'GxB_BY_ROW'; if \verb'|J|' is small, then it is -fastest if the format of \verb'C' is \verb'GxB_BY_COL'. The opposite is true +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 @@ -12078,7 +10371,7 @@ \subsection{Duplicate indices in {\sf GrB\_assign} and {\sf GxB\_subassign}} {\small \begin{verbatim} #include "GraphBLAS.h" - #undef I /* complex.h #define's I, used below as an array */ + #undef I /* complex.h #define's I, but I is used an array below */ #include int main (void) { @@ -12499,7 +10792,7 @@ \subsubsection{Performance of {\sf GxB\_subassign}, {\sf GrB\_assign} $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'GxB_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 @@ -13274,7 +11567,7 @@ \section{Printing GraphBLAS objects} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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'GxB_Matrix_type', and so on. The GraphBLAS C API has no mechanism for +\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: @@ -13286,7 +11579,7 @@ \section{Printing GraphBLAS objects} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \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_IndexUnaryOp_fprint' & print and check a \verb'GrB_IndexUnaryOp' \\ \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' \\ @@ -13372,7 +11665,7 @@ \section{Printing GraphBLAS objects} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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'GxB_set (GxB_PRINT_1BASED, true)'. Printing is done as zero-based by +use \verb'GrB_set (GrB_GLOBAL, true, GxB_PRINT_1BASED)'. Printing is done as zero-based by default. \newpage @@ -13711,16 +12004,16 @@ \section{Matrix and Vector iterators} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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'GxB_get (A, GxB_FORMAT, &fmt)') is by-row - (that is, \verb'GxB_BY_ROW'). + (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'GxB_get (A, GxB_FORMAT, &fmt)') is - by-column (that is, \verb'GxB_BY_COL'). + 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 @@ -14944,7 +13237,7 @@ \section{Performance} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{The burble is your friend} %------------------------------------------------------------------------------- -Turn on the burble with \verb'GxB_set (GxB_BURBLE, true)'. You will get a +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. @@ -14986,12 +13279,12 @@ \subsection{Matrix data structures: sparse, hypersparse, bitmap, or full} 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'GxB_set'. For example, +at different times. This can be modified via \verb'GrB_set'. For example, this line of code: {\footnotesize \begin{verbatim} - GxB_set (A, GxB_SPARSITY_CONTROL, GxB_SPARSE + GxB_BITMAP) ; \end{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 @@ -15002,7 +13295,7 @@ \subsection{Matrix data structures: sparse, hypersparse, bitmap, or full} {\footnotesize \begin{verbatim} - GxB_set (A, GxB_SPARSITY_CONTROL, GxB_SPARSE) ; \end{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 @@ -15048,7 +13341,7 @@ \subsection{Matrix formats: by row or by column, or using the transpose of 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'GxB_set'. For +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': @@ -15061,7 +13354,7 @@ \subsection{Matrix formats: by row or by column, or using the transpose of // 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) ; - GxB_set (A2, GxB_FORMAT, GxB_BY_COL) ; + 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 @@ -15097,7 +13390,7 @@ \subsection{Push/pull optimization} {\footnotesize \begin{verbatim} int sparsity = do_push ? GxB_SPARSE : GxB_BITMAP ; - GxB_set (q, GxB_SPARSITY_CONTROL, sparsity) ; + GrB_set (q, sparsity, GxB_SPARSITY_CONTROL) ; if (do_push) { // q'{!pi} = q'*A @@ -15109,7 +13402,7 @@ \subsection{Push/pull optimization} GrB_mxv (q, pi, NULL, semiring, AT, q, GrB_DESC_RSC) ; }\end{verbatim}} -The call to \verb'GxB_set' is optional, since SuiteSparse will likely already +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 @@ -15551,7 +13844,7 @@ \subsection{Reading a matrix from a file} {\footnotesize \begin{verbatim} GrB_Descriptor_new (&dt2) ; - GrB_Descriptor_set (dt2, GrB_INP1, GrB_TRAN) ; + 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) ; @@ -15601,7 +13894,7 @@ \subsection{Reading a matrix from a file} {\footnotesize \begin{verbatim} GrB_Descriptor_new (&dt1) ; - GrB_Descriptor_set (dt1, GrB_INP0, GrB_TRAN) ; + 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) ; @@ -15667,7 +13960,7 @@ \subsection{User-defined types and operators} 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 ANSI C11 \verb'double complex' type. +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 @@ -15746,7 +14039,7 @@ \section{Compiling and Installing SuiteSparse:GraphBLAS} \subsection{On Linux and Mac} %---------------------------------------- -GraphBLAS makes extensive use of features in the ANSI C11 standard, and thus a +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. @@ -15816,7 +14109,7 @@ \subsection{On Linux and Mac} GraphBLAS folder. If \verb'cmake' or \verb'make' fail, it might be that your default compiler -does not support ANSI C11. Try another compiler. For example, try one of +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 @@ -15998,7 +14291,7 @@ \subsection{On Microsoft Windows} %---------------------------------------- SuiteSparse:GraphBLAS is now ported to Microsoft Visual Studio. However, that -compiler is not ANSI C11 compliant. As a result, GraphBLAS on Windows will have +compiler is not C11 compliant. As a result, GraphBLAS on Windows will have a few minor limitations. \begin{itemize} @@ -16341,7 +14634,7 @@ \subsection{Setting the C flags and using CMake} # check which compiler is being used. If you need to make # compiler-specific modifications, here is the place to do it. if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") - # cmake 2.8 workaround: gcc needs to be told to do ANSI C11. + # 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} -std=c11 -lm " ) ... @@ -16475,16 +14768,37 @@ \section{Release Notes} \begin{itemize} -\item Dec 30, 2023: version 8.3.1 +\item Version 9.0.0, Jan 10, 2024 \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 \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.0 +\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} @@ -16499,7 +14813,7 @@ \section{Release Notes} \item cmake update: add "None" build type, from Antonio Rojas, for Arch Linux \end{itemize} -\item Version 8.2.0, Sept 5, 2023 +\item Version 8.2.0, Sept 8, 2023 \begin{itemize} \item cmake updates: \verb'SuiteSparse::' namespace by Markus M\"{u}tzel. @@ -16611,7 +14925,7 @@ \section{Release Notes} \begin{itemize} \item add non-\verb'va_arg' methods: \verb'va_arg'-based \verb'GxB_get/set' - methods are ANSI C11 but cause issues for cffi in Python. As a + 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 @@ -17202,7 +15516,7 @@ \section{Release Notes} 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 ANSI C11 + 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. diff --git a/GraphBLAS/Doc/GraphBLAS_version.tex b/GraphBLAS/Doc/GraphBLAS_version.tex index 391725e42e..0d7f0a5699 100644 --- a/GraphBLAS/Doc/GraphBLAS_version.tex +++ b/GraphBLAS/Doc/GraphBLAS_version.tex @@ -1,5 +1,5 @@ % version of SuiteSparse:GraphBLAS \date{VERSION -8.3.1, -Dec 30, 2023} +9.0.0, +Jan 10, 2024} diff --git a/GraphBLAS/Doc/Makefile b/GraphBLAS/Doc/Makefile index 2d29532ab3..26b393ca65 100644 --- a/GraphBLAS/Doc/Makefile +++ b/GraphBLAS/Doc/Makefile @@ -10,7 +10,7 @@ # creates the user guide GraphBLAS_UserGuide.pdf: GraphBLAS_UserGuide.tex GraphBLAS_UserGuide.bib \ - GraphBLAS_API_version.tex GraphBLAS_version.tex + GraphBLAS_API_version.tex GraphBLAS_version.tex GrB_get_set.tex pdflatex GraphBLAS_UserGuide.tex bibtex GraphBLAS_UserGuide pdflatex GraphBLAS_UserGuide.tex diff --git a/GraphBLAS/Doc/README_Doc.txt b/GraphBLAS/Doc/README_Doc.txt index 6039388501..05ea770afb 100644 --- a/GraphBLAS/Doc/README_Doc.txt +++ b/GraphBLAS/Doc/README_Doc.txt @@ -9,7 +9,7 @@ This folder contains the following files: GraphBLAS_API_C_2.0.0.pdf v2.0 C API (see https://graphblas.org) GraphBLAS_API_version.tex the version of the C API that this version of SuiteSparse:GraphBLAS conforms to. - GraphBLAS_UserGuide.pdf the SuiteSparse:GraphBLAS User Guide + GraphBLAS_UserGuide.pdf the SuiteSparse:GraphBLAS User Guide GraphBLAS_UserGuide.tex LaTeX source of the User Guide GraphBLAS_UserGuide.bib diff --git a/GraphBLAS/Doc/TODO.txt b/GraphBLAS/Doc/TODO.txt deleted file mode 100644 index d855b49b68..0000000000 --- a/GraphBLAS/Doc/TODO.txt +++ /dev/null @@ -1,18 +0,0 @@ -For SS:GrB v9.0.0: - - track any changes to the v2.1 C API and release v9.0.0 when the - v2.1 C API is released. - -Future features: - - pack/unpack COO - kernel fusion - CUDA kernels - fine-grain parallelism for dot-product based mxm, mxv, vxm, - then add GxB_vxvt (outer product) and GxB_vtxv (inner product) - (or call them GxB_outerProduct and GxB_innerProduct?) - - aggregators - index binary ops - GrB_extract with GrB_Vectors instead of (GrB_Index *) arrays for I and J - diff --git a/GraphBLAS/GraphBLAS/@GrB/binopinfo.m b/GraphBLAS/GraphBLAS/@GrB/binopinfo.m index ce9c5ff3ea..5d9dcd8830 100644 --- a/GraphBLAS/GraphBLAS/@GrB/binopinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/binopinfo.m @@ -87,7 +87,7 @@ function binopinfo (op, optype) % 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 -% definitions are identical to the ANSI C11 versions of these functions: +% 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. % diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_error.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_error.c index 37f9db650b..0f5e1b1106 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_error.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_error.c @@ -38,6 +38,7 @@ const char *gb_error // return an error message from a GrB_Info value case GrB_DIMENSION_MISMATCH : return ("matrix dimensions are invalid") ; case GrB_OUTPUT_NOT_EMPTY : return ("output matrix already has values") ; case GrB_NOT_IMPLEMENTED : return ("method not implemented") ; + case GrB_ALREADY_SET : return ("name already set") ; case GrB_OUT_OF_MEMORY : return ("out of memory") ; case GrB_INSUFFICIENT_SPACE : return ("output array not large enough") ; case GrB_INVALID_OBJECT : return ("object is corrupted") ; 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 b2daf8f7dd..24dce5ac04 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxstruct.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxstruct.c @@ -166,9 +166,12 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G // 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)) ; - OK (GxB_Matrix_export_CSC (&Y, &ytype, &ynrows, &yvdim, - &Yp, &Yi, &Yx, &Yp_size, &Yi_size, &Yx_size, - NULL, NULL, 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) @@ -223,9 +226,10 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G break ; case GxB_HYPERSPARSE : - // A is hypersparse, with 9 fields: GraphBLAS*, s, x, p, i, h, + // A is hypersparse, with 6 or 9 fields: GraphBLAS*, s, x, p, i, h, // Yp, Yi, Yx - G = mxCreateStructMatrix (1, 1, 9, MatrixFields) ; + G = mxCreateStructMatrix (1, 1, (Yp == NULL) ? 6 : 9, + MatrixFields) ; break ; case GxB_BITMAP : @@ -308,26 +312,33 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G } mxSetFieldByNumber (G, 0, 5, Ah_mx) ; - // export Yp, of size yvdim+1 - mxArray *Yp_mx = mxCreateNumericMatrix (1, 0, mxUINT64_CLASS, mxREAL) ; - mxSetN (Yp_mx, yvdim+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) ; - 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) ; - p = (void *) mxGetData (Yx_mx) ; gb_mxfree (&p) ; - mxSetData (Yx_mx, Yx) ; - mxSetFieldByNumber (G, 0, 8, Yx_mx) ; + if (Yp != NULL) + { + + // export Yp, of size yvdim+1 + mxArray *Yp_mx = mxCreateNumericMatrix (1, 0, mxUINT64_CLASS, + mxREAL) ; + mxSetN (Yp_mx, yvdim+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) ; + 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) ; + p = (void *) mxGetData (Yx_mx) ; gb_mxfree (&p) ; + mxSetData (Yx_mx, Yx) ; + mxSetFieldByNumber (G, 0, 8, Yx_mx) ; + } } if (sparsity_status == GxB_BITMAP) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_shallow.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_shallow.c index e99858af45..96d8ca6c60 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_shallow.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_shallow.c @@ -344,10 +344,10 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix } //---------------------------------------------------------------------- - // import the A->Y hyper_hash + // import the A->Y hyper_hash, if it exists //---------------------------------------------------------------------- - if (yvdim > 0) + if (nfields == 9) { // A->Y is sparse, uint64, (A->vdim)-by-yvdim, held by column OK (GrB_Matrix_new (&Y, GrB_UINT64, vdim, yvdim)) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/unopinfo.m b/GraphBLAS/GraphBLAS/@GrB/unopinfo.m index 2c90e017ad..05e9a2c9af 100644 --- a/GraphBLAS/GraphBLAS/@GrB/unopinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/unopinfo.m @@ -71,8 +71,8 @@ function unopinfo (op, type) % erf z = erf (x) error function % erfc z = erfc (x) complementary error function % cbrt z = cbrt (x) cube root -% frexpx z = frexpx (x) mantissa from ANSI C11 frexp function -% frexpe z = frexpe (x) exponent from ANSI C11 frexp function; +% frexpx z = frexpx (x) mantissa from C11 frexp function +% frexpe z = frexpe (x) exponent from C11 frexp function; % the built-in [f,e]=log2(x) returns % f = frexpx (x) and e = frexpe (x). % diff --git a/GraphBLAS/GraphBLAS/CMakeLists.txt b/GraphBLAS/GraphBLAS/CMakeLists.txt index 5251f12075..a1e795b4d0 100644 --- a/GraphBLAS/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/GraphBLAS/CMakeLists.txt @@ -69,7 +69,7 @@ if ( NOT SUITESPARSE_USE_OPENMP ) set ( GRAPHBLAS_USE_OPENMP "OFF" CACHE STRING "" FORCE ) endif ( ) if ( GRAPHBLAS_USE_OPENMP ) - find_package ( OpenMP ) + find_package ( OpenMP COMPONENTS C ) else ( ) # OpenMP has been disabled set ( OpenMP_C_FOUND OFF ) diff --git a/GraphBLAS/GraphBLAS/demo/html/graphblas_demo.html b/GraphBLAS/GraphBLAS/demo/html/graphblas_demo.html index 308aa48591..cab72de9cc 100644 --- a/GraphBLAS/GraphBLAS/demo/html/graphblas_demo.html +++ b/GraphBLAS/GraphBLAS/demo/html/graphblas_demo.html @@ -404,7 +404,7 @@ 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 - definitions are identical to the ANSI C11 versions of these functions: + 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. @@ -569,8 +569,8 @@ tgamma z = tgamma (x) gamma function, also 'gamma' erf z = erf (x) error function erfc z = erfc (x) complementary error function - frexpx z = frexpx (x) mantissa from ANSI C11 frexp function - frexpe z = frexpe (x) exponent from ANSI C11 frexp function; + frexpx z = frexpx (x) mantissa from C11 frexp function + frexpe z = frexpe (x) exponent from C11 frexp function; the built-in [f,e]=log2(x) returns f = frexpx (x) and e = frexpe (x). diff --git a/GraphBLAS/GraphBLAS/rename/GB_rename.h b/GraphBLAS/GraphBLAS/rename/GB_rename.h index 262192620d..a2a7b272ee 100644 --- a/GraphBLAS/GraphBLAS/rename/GB_rename.h +++ b/GraphBLAS/GraphBLAS/rename/GB_rename.h @@ -221,6 +221,7 @@ #define GB_clog2f GM_clog2f #define GB_clog2 GM_clog2 #define GB_code_check GM_code_check +#define GB_code_name_get GM_code_name_get #define GB_code_size GM_code_size #define GB_code_string GM_code_string #define GB_code_type GM_code_type @@ -409,6 +410,8 @@ #define GB_Global_hack_get GM_Global_hack_get #define GB_Global_hack_set GM_Global_hack_set #define GB_Global_have_realloc_function GM_Global_have_realloc_function +#define GB_Global_hyper_hash_get GM_Global_hyper_hash_get +#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_is_csc_get GM_Global_is_csc_get @@ -494,6 +497,7 @@ #define GB_HUF_writeCTable_wksp GM_HUF_writeCTable_wksp #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 @@ -910,12 +914,19 @@ #define GB_Matrix_new GM_Matrix_new #define GB_Matrix_removeElement GM_Matrix_removeElement #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 +#define GB_matvec_name_set GM_matvec_name_set +#define GB_matvec_name_size_get GM_matvec_name_size_get +#define GB_matvec_set GM_matvec_set #define GB_matvec_type GM_matvec_type #define GB_matvec_type_name GM_matvec_type_name #define GB_memcpy GM_memcpy #define GB_memoryUsage GM_memoryUsage #define GB_memset GM_memset #define GB_Monoid_check GM_Monoid_check +#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 @@ -935,10 +946,17 @@ #define GB_nvec_nonempty GM_nvec_nonempty #define GB_omp_get_max_threads GM_omp_get_max_threads #define GB_omp_get_wtime GM_omp_get_wtime +#define GB_op_enum_get GM_op_enum_get #define GB_Operator_check GM_Operator_check #define GB_Op_free GM_Op_free #define GB_op_is_second GM_op_is_second #define GB_op_name_and_defn GM_op_name_and_defn +#define GB_op_name_get GM_op_name_get +#define GB_op_or_type_string_set GM_op_or_type_string_set +#define GB_op_scalar_get GM_op_scalar_get +#define GB_op_size_get GM_op_size_get +#define GB_op_string_get GM_op_string_get +#define GB_op_string_set GM_op_string_set #define GB_Pending_alloc GM_Pending_alloc #define GB_Pending_free GM_Pending_free #define GB_Pending_n GM_Pending_n @@ -1009,6 +1027,7 @@ #define GB_select_sparse GM_select_sparse #define GB_select_value_iso GM_select_value_iso #define GB_Semiring_check GM_Semiring_check +#define GB_semiring_name_get GM_semiring_name_get #define GB_Semiring_new GM_Semiring_new #define GB_serialize_array GM_serialize_array #define GB_serialize_free_blocks GM_serialize_free_blocks @@ -1085,7 +1104,9 @@ #define GB_transpose_op GM_transpose_op #define GB_transpose_unop_jit GM_transpose_unop_jit #define GB_Type_check GM_Type_check +#define GB_type_code_get GM_type_code_get #define GB_Type_compatible GM_Type_compatible +#define GB_type_name_get GM_type_name_get #define GB_UnaryOp_check GM_UnaryOp_check #define GB_union_jit GM_union_jit #define GB_unjumble GM_unjumble @@ -1094,6 +1115,7 @@ #define GB_unop_iso GM_unop_iso #define GB_unop_new GM_unop_new #define GB_unop_one GM_unop_one +#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_check GM_Vector_check @@ -1421,6 +1443,16 @@ #define GrB_BAND_UINT8 GrM_BAND_UINT8 #define GrB_BinaryOp_error GrM_BinaryOp_error #define GrB_BinaryOp_free GrM_BinaryOp_free +#define GrB_BinaryOp_get_INT32 GrM_BinaryOp_get_INT32 +#define GrB_BinaryOp_get_Scalar GrM_BinaryOp_get_Scalar +#define GrB_BinaryOp_get_SIZE GrM_BinaryOp_get_SIZE +#define GrB_BinaryOp_get_String GrM_BinaryOp_get_String +#define GrB_BinaryOp_get_VOID GrM_BinaryOp_get_VOID +#define GrB_BinaryOp_new GrM_BinaryOp_new +#define GrB_BinaryOp_set_INT32 GrM_BinaryOp_set_INT32 +#define GrB_BinaryOp_set_Scalar GrM_BinaryOp_set_Scalar +#define GrB_BinaryOp_set_String GrM_BinaryOp_set_String +#define GrB_BinaryOp_set_VOID GrM_BinaryOp_set_VOID #define GrB_BinaryOp_wait GrM_BinaryOp_wait #define GrB_BNOT_INT16 GrM_BNOT_INT16 #define GrB_BNOT_INT32 GrM_BNOT_INT32 @@ -1472,8 +1504,17 @@ #define GrB_DESC_R GrM_DESC_R #define GrB_Descriptor_error GrM_Descriptor_error #define GrB_Descriptor_free GrM_Descriptor_free +#define GrB_Descriptor_get_INT32 GrM_Descriptor_get_INT32 +#define GrB_Descriptor_get_Scalar GrM_Descriptor_get_Scalar +#define GrB_Descriptor_get_SIZE GrM_Descriptor_get_SIZE +#define GrB_Descriptor_get_String GrM_Descriptor_get_String +#define GrB_Descriptor_get_VOID GrM_Descriptor_get_VOID #define GrB_Descriptor_new GrM_Descriptor_new #define GrB_Descriptor_set GrM_Descriptor_set +#define GrB_Descriptor_set_INT32 GrM_Descriptor_set_INT32 +#define GrB_Descriptor_set_Scalar GrM_Descriptor_set_Scalar +#define GrB_Descriptor_set_String GrM_Descriptor_set_String +#define GrB_Descriptor_set_VOID GrM_Descriptor_set_VOID #define GrB_Descriptor_wait GrM_Descriptor_wait #define GrB_DESC_RSC GrM_DESC_RSC #define GrB_DESC_RSCT0 GrM_DESC_RSCT0 @@ -1548,6 +1589,16 @@ #define GrB_GE_UINT32 GrM_GE_UINT32 #define GrB_GE_UINT64 GrM_GE_UINT64 #define GrB_GE_UINT8 GrM_GE_UINT8 +#define GrB_Global_get_INT32 GrM_Global_get_INT32 +#define GrB_Global_get_Scalar GrM_Global_get_Scalar +#define GrB_Global_get_SIZE GrM_Global_get_SIZE +#define GrB_Global_get_String GrM_Global_get_String +#define GrB_Global_get_VOID GrM_Global_get_VOID +#define GrB_GLOBAL GrM_GLOBAL +#define GrB_Global_set_INT32 GrM_Global_set_INT32 +#define GrB_Global_set_Scalar GrM_Global_set_Scalar +#define GrB_Global_set_String GrM_Global_set_String +#define GrB_Global_set_VOID GrM_Global_set_VOID #define GrB_GT_BOOL GrM_GT_BOOL #define GrB_GT_FP32 GrM_GT_FP32 #define GrB_GT_FP64 GrM_GT_FP64 @@ -1572,6 +1623,16 @@ #define GrB_IDENTITY_UINT8 GrM_IDENTITY_UINT8 #define GrB_IndexUnaryOp_error GrM_IndexUnaryOp_error #define GrB_IndexUnaryOp_free GrM_IndexUnaryOp_free +#define GrB_IndexUnaryOp_get_INT32 GrM_IndexUnaryOp_get_INT32 +#define GrB_IndexUnaryOp_get_Scalar GrM_IndexUnaryOp_get_Scalar +#define GrB_IndexUnaryOp_get_SIZE GrM_IndexUnaryOp_get_SIZE +#define GrB_IndexUnaryOp_get_String GrM_IndexUnaryOp_get_String +#define GrB_IndexUnaryOp_get_VOID GrM_IndexUnaryOp_get_VOID +#define GrB_IndexUnaryOp_new GrM_IndexUnaryOp_new +#define GrB_IndexUnaryOp_set_INT32 GrM_IndexUnaryOp_set_INT32 +#define GrB_IndexUnaryOp_set_Scalar GrM_IndexUnaryOp_set_Scalar +#define GrB_IndexUnaryOp_set_String GrM_IndexUnaryOp_set_String +#define GrB_IndexUnaryOp_set_VOID GrM_IndexUnaryOp_set_VOID #define GrB_IndexUnaryOp_wait GrM_IndexUnaryOp_wait #define GrB_init GrM_init #define GrB_INT16 GrM_INT16 @@ -1731,6 +1792,11 @@ #define GrB_Matrix_extractTuples_UINT64 GrM_Matrix_extractTuples_UINT64 #define GrB_Matrix_extractTuples_UINT8 GrM_Matrix_extractTuples_UINT8 #define GrB_Matrix_free GrM_Matrix_free +#define GrB_Matrix_get_INT32 GrM_Matrix_get_INT32 +#define GrB_Matrix_get_Scalar GrM_Matrix_get_Scalar +#define GrB_Matrix_get_SIZE GrM_Matrix_get_SIZE +#define GrB_Matrix_get_String GrM_Matrix_get_String +#define GrB_Matrix_get_VOID GrM_Matrix_get_VOID #define GrB_Matrix_import_BOOL GrM_Matrix_import_BOOL #define GrB_Matrix_import_FP32 GrM_Matrix_import_FP32 #define GrB_Matrix_import_FP64 GrM_Matrix_import_FP64 @@ -1796,6 +1862,10 @@ #define GrB_Matrix_setElement_UINT32 GrM_Matrix_setElement_UINT32 #define GrB_Matrix_setElement_UINT64 GrM_Matrix_setElement_UINT64 #define GrB_Matrix_setElement_UINT8 GrM_Matrix_setElement_UINT8 +#define GrB_Matrix_set_INT32 GrM_Matrix_set_INT32 +#define GrB_Matrix_set_Scalar GrM_Matrix_set_Scalar +#define GrB_Matrix_set_String GrM_Matrix_set_String +#define GrB_Matrix_set_VOID GrM_Matrix_set_VOID #define GrB_Matrix_wait GrM_Matrix_wait #define GrB_MAX_BOOL GrM_MAX_BOOL #define GrB_MAX_FIRST_SEMIRING_FP32 GrM_MAX_FIRST_SEMIRING_FP32 @@ -1963,6 +2033,11 @@ #define GrB_MINV_UINT8 GrM_MINV_UINT8 #define GrB_Monoid_error GrM_Monoid_error #define GrB_Monoid_free GrM_Monoid_free +#define GrB_Monoid_get_INT32 GrM_Monoid_get_INT32 +#define GrB_Monoid_get_Scalar GrM_Monoid_get_Scalar +#define GrB_Monoid_get_SIZE GrM_Monoid_get_SIZE +#define GrB_Monoid_get_String GrM_Monoid_get_String +#define GrB_Monoid_get_VOID GrM_Monoid_get_VOID #define GrB_Monoid_new_BOOL GrM_Monoid_new_BOOL #define GrB_Monoid_new_FP32 GrM_Monoid_new_FP32 #define GrB_Monoid_new_FP64 GrM_Monoid_new_FP64 @@ -1975,6 +2050,10 @@ #define GrB_Monoid_new_UINT32 GrM_Monoid_new_UINT32 #define GrB_Monoid_new_UINT64 GrM_Monoid_new_UINT64 #define GrB_Monoid_new_UINT8 GrM_Monoid_new_UINT8 +#define GrB_Monoid_set_INT32 GrM_Monoid_set_INT32 +#define GrB_Monoid_set_Scalar GrM_Monoid_set_Scalar +#define GrB_Monoid_set_String GrM_Monoid_set_String +#define GrB_Monoid_set_VOID GrM_Monoid_set_VOID #define GrB_Monoid_wait GrM_Monoid_wait #define GrB_mxm GrM_mxm #define GrB_mxv GrM_mxv @@ -2063,6 +2142,11 @@ #define GrB_Scalar_extractElement_UINT64 GrM_Scalar_extractElement_UINT64 #define GrB_Scalar_extractElement_UINT8 GrM_Scalar_extractElement_UINT8 #define GrB_Scalar_free GrM_Scalar_free +#define GrB_Scalar_get_INT32 GrM_Scalar_get_INT32 +#define GrB_Scalar_get_Scalar GrM_Scalar_get_Scalar +#define GrB_Scalar_get_SIZE GrM_Scalar_get_SIZE +#define GrB_Scalar_get_String GrM_Scalar_get_String +#define GrB_Scalar_get_VOID GrM_Scalar_get_VOID #define GrB_Scalar_new GrM_Scalar_new #define GrB_Scalar_nvals GrM_Scalar_nvals #define GrB_Scalar_setElement_BOOL GrM_Scalar_setElement_BOOL @@ -2077,6 +2161,10 @@ #define GrB_Scalar_setElement_UINT32 GrM_Scalar_setElement_UINT32 #define GrB_Scalar_setElement_UINT64 GrM_Scalar_setElement_UINT64 #define GrB_Scalar_setElement_UINT8 GrM_Scalar_setElement_UINT8 +#define GrB_Scalar_set_INT32 GrM_Scalar_set_INT32 +#define GrB_Scalar_set_Scalar GrM_Scalar_set_Scalar +#define GrB_Scalar_set_String GrM_Scalar_set_String +#define GrB_Scalar_set_VOID GrM_Scalar_set_VOID #define GrB_Scalar_wait GrM_Scalar_wait #define GrB_SECOND_BOOL GrM_SECOND_BOOL #define GrB_SECOND_FP32 GrM_SECOND_FP32 @@ -2091,7 +2179,16 @@ #define GrB_SECOND_UINT8 GrM_SECOND_UINT8 #define GrB_Semiring_error GrM_Semiring_error #define GrB_Semiring_free GrM_Semiring_free +#define GrB_Semiring_get_INT32 GrM_Semiring_get_INT32 +#define GrB_Semiring_get_Scalar GrM_Semiring_get_Scalar +#define GrB_Semiring_get_SIZE GrM_Semiring_get_SIZE +#define GrB_Semiring_get_String GrM_Semiring_get_String +#define GrB_Semiring_get_VOID GrM_Semiring_get_VOID #define GrB_Semiring_new GrM_Semiring_new +#define GrB_Semiring_set_INT32 GrM_Semiring_set_INT32 +#define GrB_Semiring_set_Scalar GrM_Semiring_set_Scalar +#define GrB_Semiring_set_String GrM_Semiring_set_String +#define GrB_Semiring_set_VOID GrM_Semiring_set_VOID #define GrB_Semiring_wait GrM_Semiring_wait #define GrB_TIMES_BOOL GrM_TIMES_BOOL #define GrB_TIMES_FP32 GrM_TIMES_FP32 @@ -2119,6 +2216,16 @@ #define GrB_TRIU GrM_TRIU #define GrB_Type_error GrM_Type_error #define GrB_Type_free GrM_Type_free +#define GrB_Type_get_INT32 GrM_Type_get_INT32 +#define GrB_Type_get_Scalar GrM_Type_get_Scalar +#define GrB_Type_get_SIZE GrM_Type_get_SIZE +#define GrB_Type_get_String GrM_Type_get_String +#define GrB_Type_get_VOID GrM_Type_get_VOID +#define GrB_Type_new GrM_Type_new +#define GrB_Type_set_INT32 GrM_Type_set_INT32 +#define GrB_Type_set_Scalar GrM_Type_set_Scalar +#define GrB_Type_set_String GrM_Type_set_String +#define GrB_Type_set_VOID GrM_Type_set_VOID #define GrB_Type_wait GrM_Type_wait #define GrB_UINT16 GrM_UINT16 #define GrB_UINT32 GrM_UINT32 @@ -2126,6 +2233,16 @@ #define GrB_UINT8 GrM_UINT8 #define GrB_UnaryOp_error GrM_UnaryOp_error #define GrB_UnaryOp_free GrM_UnaryOp_free +#define GrB_UnaryOp_get_INT32 GrM_UnaryOp_get_INT32 +#define GrB_UnaryOp_get_Scalar GrM_UnaryOp_get_Scalar +#define GrB_UnaryOp_get_SIZE GrM_UnaryOp_get_SIZE +#define GrB_UnaryOp_get_String GrM_UnaryOp_get_String +#define GrB_UnaryOp_get_VOID GrM_UnaryOp_get_VOID +#define GrB_UnaryOp_new GrM_UnaryOp_new +#define GrB_UnaryOp_set_INT32 GrM_UnaryOp_set_INT32 +#define GrB_UnaryOp_set_Scalar GrM_UnaryOp_set_Scalar +#define GrB_UnaryOp_set_String GrM_UnaryOp_set_String +#define GrB_UnaryOp_set_VOID GrM_UnaryOp_set_VOID #define GrB_UnaryOp_wait GrM_UnaryOp_wait #define GrB_VALUEEQ_BOOL GrM_VALUEEQ_BOOL #define GrB_VALUEEQ_FP32 GrM_VALUEEQ_FP32 @@ -2295,6 +2412,11 @@ #define GrB_Vector_extractTuples_UINT64 GrM_Vector_extractTuples_UINT64 #define GrB_Vector_extractTuples_UINT8 GrM_Vector_extractTuples_UINT8 #define GrB_Vector_free GrM_Vector_free +#define GrB_Vector_get_INT32 GrM_Vector_get_INT32 +#define GrB_Vector_get_Scalar GrM_Vector_get_Scalar +#define GrB_Vector_get_SIZE GrM_Vector_get_SIZE +#define GrB_Vector_get_String GrM_Vector_get_String +#define GrB_Vector_get_VOID GrM_Vector_get_VOID #define GrB_Vector_new GrM_Vector_new #define GrB_Vector_nvals GrM_Vector_nvals #define GrB_Vector_reduce_BinaryOp_Scalar GrM_Vector_reduce_BinaryOp_Scalar @@ -2339,6 +2461,10 @@ #define GrB_Vector_setElement_UINT32 GrM_Vector_setElement_UINT32 #define GrB_Vector_setElement_UINT64 GrM_Vector_setElement_UINT64 #define GrB_Vector_setElement_UINT8 GrM_Vector_setElement_UINT8 +#define GrB_Vector_set_INT32 GrM_Vector_set_INT32 +#define GrB_Vector_set_Scalar GrM_Vector_set_Scalar +#define GrB_Vector_set_String GrM_Vector_set_String +#define GrB_Vector_set_VOID GrM_Vector_set_VOID #define GrB_Vector_size GrM_Vector_size #define GrB_Vector_wait GrM_Vector_wait #define GrB_vxm GrM_vxm @@ -2858,10 +2984,19 @@ #define GxB_Context_get_FP64 GxM_Context_get_FP64 #define GxB_Context_get GxM_Context_get #define GxB_Context_get_INT32 GxM_Context_get_INT32 +#define GxB_Context_get_INT GxM_Context_get_INT +#define GxB_Context_get_Scalar GxM_Context_get_Scalar +#define GxB_Context_get_SIZE GxM_Context_get_SIZE +#define GxB_Context_get_String GxM_Context_get_String +#define GxB_Context_get_VOID GxM_Context_get_VOID #define GxB_Context_new GxM_Context_new #define GxB_Context_set_FP64 GxM_Context_set_FP64 #define GxB_Context_set GxM_Context_set #define GxB_Context_set_INT32 GxM_Context_set_INT32 +#define GxB_Context_set_INT GxM_Context_set_INT +#define GxB_Context_set_Scalar GxM_Context_set_Scalar +#define GxB_Context_set_String GxM_Context_set_String +#define GxB_Context_set_VOID GxM_Context_set_VOID #define GxB_Context_wait GxM_Context_wait #define GxB_CONTEXT_WORLD GxM_CONTEXT_WORLD #define GxB_COPYSIGN_FP32 GxM_COPYSIGN_FP32 @@ -4369,6 +4504,11 @@ #define GxB_Semiring_add GxM_Semiring_add #define GxB_Semiring_fprint GxM_Semiring_fprint #define GxB_Semiring_multiply GxM_Semiring_multiply +#define GxB_Serialized_get_INT32 GxM_Serialized_get_INT32 +#define GxB_Serialized_get_Scalar GxM_Serialized_get_Scalar +#define GxB_Serialized_get_SIZE GxM_Serialized_get_SIZE +#define GxB_Serialized_get_String GxM_Serialized_get_String +#define GxB_Serialized_get_VOID GxM_Serialized_get_VOID #define GxB_SIGNUM_FC32 GxM_SIGNUM_FC32 #define GxB_SIGNUM_FC64 GxM_SIGNUM_FC64 #define GxB_SIGNUM_FP32 GxM_SIGNUM_FP32 diff --git a/GraphBLAS/GraphBLAS/rename/Makefile b/GraphBLAS/GraphBLAS/rename/Makefile index 16d517e9a6..0b0f25624f 100644 --- a/GraphBLAS/GraphBLAS/rename/Makefile +++ b/GraphBLAS/GraphBLAS/rename/Makefile @@ -13,18 +13,14 @@ # libgraphblas_matlab.so with renamed symbols, to avoid conflicting with the # built-in libmwgraphblas.so (v3.3.3) in MATLAB R2021a and later. -# GrB_Type_new, GrB_UnaryOp_new, GrB_BinaryOp_new, and GxB_*Iterator* methods -# are #define'd as both macros and functions in GraphBLAS.h, so they are not -# renamed. Functions with "__" in their name are renamed using macros -# internally, and so they do not need to be renamed with GB_rename.h. +# GxB_*Iterator* methods are #define'd as both macros and functions in +# GraphBLAS.h, so they are not renamed. Functions with "__" in their name are +# renamed using macros internally, and so they do not need to be renamed with +# GB_rename.h. go: nm -gD ../../build/libgraphblas.so | grep -v "__" > lib - grep " GrB_" lib \ - | grep -v GrB_Type_new \ - | grep -v GrB_UnaryOp_new \ - | grep -v GrB_IndexUnaryOp_new \ - | grep -v GrB_BinaryOp_new > temp.h + grep " GrB_" lib > temp.h grep " GxB_" lib \ | grep -v Iterator >> temp.h grep " GB_" lib \ @@ -38,11 +34,7 @@ go: # on the Mac, use "make mac" mac: nm -gA ../../build/libgraphblas.dylib | grep -v "__" > lib - grep " _GrB_" lib \ - | grep -v GrB_Type_new \ - | grep -v GrB_UnaryOp_new \ - | grep -v GrB_IndexUnaryOp_new \ - | grep -v GrB_BinaryOp_new > temp.h + grep " _GrB_" lib > temp.h grep " _GxB_" lib \ | grep -v Iterator >> temp.h grep " _GB_" lib \ diff --git a/GraphBLAS/Include/GraphBLAS.h b/GraphBLAS/Include/GraphBLAS.h index 1078423462..c4652b6fbb 100644 --- a/GraphBLAS/Include/GraphBLAS.h +++ b/GraphBLAS/Include/GraphBLAS.h @@ -1,9 +1,9 @@ -// SuiteSparse:GraphBLAS 8.3.1 +// SuiteSparse:GraphBLAS 9.0.0 //------------------------------------------------------------------------------ // GraphBLAS.h: definitions for the GraphBLAS package //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,10 +32,10 @@ // Regarding "historical" functions and symbols: when a GxB_* function or // symbol is added to the C API Specification, the new GrB_* name should be -// used instead. The old GxB_* name will be kept for historical reasons, -// documented here and in working order; it might no longer be mentioned in the -// user guide. Historical functions and symbols would only be removed in the -// rare case that they cause a serious conflict with future methods. +// used instead. The old GxB_* name will be kept in working order for +// historical reasons; it might no longer be mentioned in the user guide. +// Historical functions and symbols would only be removed in the rare case that +// they cause a serious conflict with future methods. #ifndef GRAPHBLAS_H #define GRAPHBLAS_H @@ -226,13 +226,13 @@ // The version of this implementation, and the GraphBLAS API version: #define GxB_IMPLEMENTATION_NAME "SuiteSparse:GraphBLAS" -#define GxB_IMPLEMENTATION_DATE "Dec 30, 2023" -#define GxB_IMPLEMENTATION_MAJOR 8 -#define GxB_IMPLEMENTATION_MINOR 3 -#define GxB_IMPLEMENTATION_SUB 1 -#define GxB_SPEC_DATE "Nov 15, 2021" +#define GxB_IMPLEMENTATION_DATE "Jan 10, 2024" +#define GxB_IMPLEMENTATION_MAJOR 9 +#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 0 +#define GxB_SPEC_MINOR 1 #define GxB_SPEC_SUB 0 // compile-time access to the C API Version number of this library. @@ -246,12 +246,12 @@ // The 'about' string the describes this particular implementation of GraphBLAS: #define GxB_IMPLEMENTATION_ABOUT \ -"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved." \ +"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved." \ "\nhttp://suitesparse.com Dept of Computer Sci. & Eng, Texas A&M University.\n" // The GraphBLAS license for this particular implementation of GraphBLAS: #define GxB_IMPLEMENTATION_LICENSE \ -"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved." \ +"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved." \ "\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may\n"\ "not use SuiteSparse:GraphBLAS except in compliance with the License. You\n" \ "may obtain a copy of the License at\n\n" \ @@ -270,10 +270,11 @@ // The 'spec' string describes the GraphBLAS spec: #define GxB_SPEC_ABOUT \ -"GraphBLAS C API, by Aydin Buluc, Timothy Mattson, Scott McMillan,\n" \ -"Jose' Moreira, Carl Yang, and Benjamin Brock. Based on 'GraphBLAS\n" \ -"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" +"GraphBLAS C API, by Benjamin Brock, Aydin Buluc, Raye Kimmerer,\n" \ +"Jim Kitchen, Major Kumar, Timothy Mattson, Scott McMillan, Jose' Moreira,\n" \ +"Erik Welch, and Carl Yang. Based on 'GraphBLAS Mathematics by Jeremy\n" \ +"Kepner. See also 'Graph Algorithms in the Language of Linear Algebra,'\n" \ +"edited by J. Kepner and J. Gilbert, SIAM, 2011.\n" //============================================================================== // GrB_Index: the GraphBLAS integer @@ -330,6 +331,7 @@ typedef enum GrB_DIMENSION_MISMATCH = -6, // matrix dimensions do not match GrB_OUTPUT_NOT_EMPTY = -7, // output matrix already has values GrB_NOT_IMPLEMENTED = -8, // method not implemented + GrB_ALREADY_SET = -9, // field already written to GrB_PANIC = -101, // unknown error GrB_OUT_OF_MEMORY = -102, // out of memory GrB_INSUFFICIENT_SPACE = -103, // output array not large enough @@ -392,7 +394,12 @@ GrB_Info GrB_finalize (void) ; // finish GraphBLAS // GrB_getVersion: GraphBLAS C API version //============================================================================== -// GrB_getVersion provides a runtime access of the C API Version. +// GrB_getVersion provides a runtime access of the C API Version. Can also be +// done with two calls to GrB_Global_get_INT32 with the v2.1 C API: +// +// GrB_get (GrB_GLOBAL, &version, GrB_API_VER_MAJOR) ; +// GrB_get (GrB_GLOBAL, &subversion, GrB_API_VER_MINOR) ; + GrB_Info GrB_getVersion // runtime access to C API version number ( unsigned int *version, // returns GRB_VERSION @@ -405,13 +412,13 @@ GrB_Info GrB_getVersion // runtime access to C API version number // The GrB_Descriptor is used to modify the behavior of GraphBLAS operations. // -// GrB_OUTP: can be GxB_DEFAULT or GrB_REPLACE. If GrB_REPLACE, then C is +// GrB_OUTP: can be GrB_DEFAULT or GrB_REPLACE. If GrB_REPLACE, then C is // cleared after taking part in the accum operation but before the mask. // In other words, C = accum (C,T) is split into Z = accum(C,T) ; // C=0 ; C = Z. // -// GrB_MASK: can be GxB_DEFAULT, GrB_COMP, GrB_STRUCTURE, or set to both -// GrB_COMP and GrB_STRUCTURE. If GxB_DEFAULT, the mask is used +// GrB_MASK: can be GrB_DEFAULT, GrB_COMP, GrB_STRUCTURE, or set to both +// GrB_COMP and GrB_STRUCTURE. If GrB_DEFAULT, the mask is used // normally, where Mask(i,j)=1 means C(i,j) can be modified by C=Z, // and Mask(i,j)=0 means it cannot be modified even if Z(i,j) is has been // computed and differs from C(i,j). If GrB_COMP, this is the same as @@ -419,7 +426,7 @@ GrB_Info GrB_getVersion // runtime access to C API version number // the value of the mask is not considered, just its pattern. The // GrB_COMP and GrB_STRUCTURE settings can be combined. // -// GrB_INP0: can be GxB_DEFAULT or GrB_TRAN. If GxB_DEFAULT, the first input +// GrB_INP0: can be GrB_DEFAULT or GrB_TRAN. If GrB_DEFAULT, the first input // is used as-is. If GrB_TRAN, it is transposed. Only matrices are // transposed this way. Vectors are never transposed via the // GrB_Descriptor. @@ -429,7 +436,7 @@ GrB_Info GrB_getVersion // runtime access to C API version number // GxB_AxB_METHOD: this is a hint to SuiteSparse:GraphBLAS on which algorithm // it should use to compute C=A*B, in GrB_mxm, GrB_mxv, and GrB_vxm. // SuiteSparse:GraphBLAS has four different heuristics, and the default -// method (GxB_DEFAULT) selects between them automatically. The complete +// method (GrB_DEFAULT) selects between them automatically. The complete // rule is in the User Guide. The brief discussion here assumes all // matrices are stored by column. All methods compute the same result, // except that floating-point roundoff may differ when working on @@ -459,7 +466,7 @@ GrB_Info GrB_getVersion // runtime access to C API version number // state, with indices out of order. The sort is left pending. Some // methods can tolerate jumbled matrices on input, so this can be faster. // However, in some cases, it can be faster for GrB_mxm to sort its output -// as it is computed. With GxB_SORT set to GxB_DEFAULT, the sort is left +// as it is computed. With GxB_SORT set to GrB_DEFAULT, the sort is left // pending. With GxB_SORT set to a nonzero value, GrB_mxm typically sorts // the resulting matrix C (but not always; this is just a hint). If // GrB_init is called with GrB_BLOCKING mode, the sort will always be @@ -497,7 +504,8 @@ GrB_Desc_Field ; typedef enum { // for all GrB_Descriptor fields: - GxB_DEFAULT = 0, // default behavior of the method + GrB_DEFAULT = 0, // default behavior of the method + GxB_DEFAULT = 0, // historical; use GrB_DEFAULT instead // for GrB_OUTP only: GrB_REPLACE = 1, // clear the output before assigning new values to it @@ -505,6 +513,7 @@ typedef enum // for GrB_MASK only: GrB_COMP = 2, // use the structural complement of the input GrB_STRUCTURE = 4, // use the only pattern of the mask, not its values + GrB_COMP_STRUCTURE = 6, // shorthand for GrB_COMP + GrB_STRUCTURE // for GrB_INP0 and GrB_INP1 only: GrB_TRAN = 3, // use the transpose of the input @@ -521,7 +530,7 @@ typedef enum GrB_Desc_Value ; // default for GxB pack is to trust the input data -#define GxB_FAST_IMPORT GxB_DEFAULT +#define GxB_FAST_IMPORT ((int) GrB_DEFAULT) typedef struct GB_Descriptor_opaque *GrB_Descriptor ; @@ -530,61 +539,15 @@ GrB_Info GrB_Descriptor_new // create a new descriptor GrB_Descriptor *descriptor // handle of descriptor to create ) ; -GrB_Info GrB_Descriptor_set // set a parameter in a descriptor -( - GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change - GrB_Desc_Value val // value to change it to -) ; - -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 means defaults - GrB_Desc_Field field // parameter to query -) ; - -GrB_Info GxB_Desc_set // set a parameter in a descriptor -( - GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change - ... // value to change it to -) ; - -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 - int32_t value // value to change it to -) ; - -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 - double value // value to change it to -) ; - -GrB_Info GxB_Desc_get // get a parameter from a descriptor -( - GrB_Descriptor desc, // descriptor to query; NULL means defaults - GrB_Desc_Field field, // parameter to query - ... // value of the parameter -) ; - -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 - int32_t *value // return value of the 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 - double *value // return value of the descriptor -) ; +// historical methods; use GrB_set and GrB_get 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_free // free a descriptor ( @@ -731,32 +694,12 @@ GB_GLOBAL GrB_Type // GrB_Type_new: create a new type //------------------------------------------------------------------------------ -// GrB_Type_new is implemented both as a macro and a function. Both are -// user-callable. The default is to use the macro, since this allows the name -// of the type to be saved as a string, for subsequent error reporting by -// GrB_error. - -#undef GrB_Type_new -#undef GrM_Type_new - -GrB_Info GRB (Type_new) // create a new GraphBLAS type +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 ) ; -// user code should not directly use GB_STR or GB_XSTR -// GB_STR: convert the content of x into a string "x" -#define GB_XSTR(x) GB_STR(x) -#define GB_STR(x) #x - -// GrB_Type_new as a user-callable macro, which allows the name of the ctype -// to be added to the new type. The type_defn is unknown. -#define GrB_Type_new(utype, sizeof_ctype) \ - GxB_Type_new(utype, sizeof_ctype, GB_STR(sizeof_ctype), NULL) -#define GrM_Type_new(utype, sizeof_ctype) \ - GxB_Type_new(utype, sizeof_ctype, GB_STR(sizeof_ctype), NULL) - // GxB_Type_new creates a type with a name and definition that are known to // GraphBLAS, as strings. The type_name is any valid string (max length of 128 // characters, including the required null-terminating character) that may @@ -786,22 +729,16 @@ GrB_Info GxB_Type_new // create a new named GraphBLAS type const char *type_defn // typedef for the type (no max length) ) ; -GrB_Info GxB_Type_name // return the name of a GraphBLAS type -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Type type -) ; - -GrB_Info GxB_Type_size // determine the size of the type -( - size_t *size, // the sizeof the type - const GrB_Type type // type to determine the sizeof -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Type_name (char *type_name, const GrB_Type type) ; +GrB_Info GxB_Type_size (size_t *size, const GrB_Type type) ; 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 + GrB_Type *type, // built-in type, or NULL if user-defined. + // The name can be the underlying C type + // ("int8_t") or the GraphBLAS name + // ("GrB_INT8"). const char *type_name // array of size at least GxB_MAX_NAME_LEN ) ; @@ -1006,23 +943,16 @@ GB_GLOBAL GrB_UnaryOp typedef void (*GxB_unary_function) (void *, const void *) ; -// GrB_UnaryOp_new creates a user-defined unary op, with an automatic -// detection of the operator name. -#undef GrB_UnaryOp_new -#undef GrM_UnaryOp_new -GrB_Info GRB (UnaryOp_new) // create a new user-defined unary operator +// GrB_UnaryOp_new creates a user-defined unary op (with no name or defn) +GrB_Info GrB_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 ) ; -#define GrB_UnaryOp_new(op,f,z,x) \ - GxB_UnaryOp_new(op,f,z,x, GB_STR(f), NULL) -#define GrM_UnaryOp_new(op,f,z,x) \ - GxM_UnaryOp_new(op,f,z,x, GB_STR(f), NULL) -// GxB_UnaryOp_new creates a named user-defined unary op. +// GxB_UnaryOp_new creates a named and defined user-defined unary op. GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator ( GrB_UnaryOp *unaryop, // handle for the new unary operator @@ -1033,29 +963,11 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator const char *unop_defn // definition of the user function ) ; -// GxB_UnaryOp_ztype is historical. Use GxB_UnaryOp_ztype_name instead. -GrB_Info GxB_UnaryOp_ztype // return the type of z -( - GrB_Type *ztype, // return type of output z - GrB_UnaryOp unaryop // unary operator -) ; -GrB_Info GxB_UnaryOp_ztype_name // return the type_name of z -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_UnaryOp unaryop // unary operator -) ; - -// GxB_UnaryOp_xtype is historical. Use GxB_UnaryOp_xtype_name instead. -GrB_Info GxB_UnaryOp_xtype // return the type of x -( - GrB_Type *xtype, // return type of input x - GrB_UnaryOp unaryop // unary operator -) ; -GrB_Info GxB_UnaryOp_xtype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_UnaryOp unaryop // unary operator -) ; +// historical; use GrB_get instead: +GrB_Info GxB_UnaryOp_ztype (GrB_Type *ztype, GrB_UnaryOp unaryop) ; +GrB_Info GxB_UnaryOp_ztype_name (char *type_name, const GrB_UnaryOp unaryop) ; +GrB_Info GxB_UnaryOp_xtype (GrB_Type *xtype, GrB_UnaryOp unaryop) ; +GrB_Info GxB_UnaryOp_xtype_name (char *type_name, const GrB_UnaryOp unaryop) ; GrB_Info GrB_UnaryOp_free // free a user-created unary operator ( @@ -1467,11 +1379,8 @@ GB_GLOBAL GrB_BinaryOp GxB_IGNORE_DUP ; typedef void (*GxB_binary_function) (void *, const void *, const void *) ; -// GrB_BinaryOp_new creates a user-defined binary op, with an automatic -// detection of the operator name. -#undef GrB_BinaryOp_new -#undef GrM_BinaryOp_new -GrB_Info GRB (BinaryOp_new) +// GrB_BinaryOp_new creates a user-defined binary op (no name or defn) +GrB_Info GrB_BinaryOp_new ( GrB_BinaryOp *binaryop, // handle for the new binary operator GxB_binary_function function, // pointer to the binary function @@ -1479,12 +1388,8 @@ GrB_Info GRB (BinaryOp_new) GrB_Type xtype, // type of input x GrB_Type ytype // type of input y ) ; -#define GrB_BinaryOp_new(op,f,z,x,y) \ - GxB_BinaryOp_new(op,f,z,x,y, GB_STR(f), NULL) -#define GrM_BinaryOp_new(op,f,z,x,y) \ - GxM_BinaryOp_new(op,f,z,x,y, GB_STR(f), NULL) -// GxB_BinaryOp_new creates a named user-defined binary op. +// GxB_BinaryOp_new creates a named and defined user-defined binary op. GrB_Info GxB_BinaryOp_new ( GrB_BinaryOp *op, // handle for the new binary operator @@ -1496,41 +1401,13 @@ GrB_Info GxB_BinaryOp_new const char *binop_defn // definition of the user function ) ; -// NOTE: GxB_BinaryOp_ztype is historical. Use GxB_BinaryOp_ztype_name instead. -GrB_Info GxB_BinaryOp_ztype // return the type of z -( - GrB_Type *ztype, // return type of output z - GrB_BinaryOp binaryop // binary operator to query -) ; -GrB_Info GxB_BinaryOp_ztype_name // return the type_name of z -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_BinaryOp binaryop // binary operator to query -) ; - -// NOTE: GxB_BinaryOp_xtype is historical. Use GxB_BinaryOp_xtype_name instead. -GrB_Info GxB_BinaryOp_xtype // return the type of x -( - GrB_Type *xtype, // return type of input x - GrB_BinaryOp binaryop // binary operator to query -) ; -GrB_Info GxB_BinaryOp_xtype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_BinaryOp binaryop // binary operator to query -) ; - -// NOTE: GxB_BinaryOp_ytype is historical. Use GxB_BinaryOp_ytype_name instead. -GrB_Info GxB_BinaryOp_ytype // return the type of y -( - GrB_Type *ytype, // return type of input y - GrB_BinaryOp binaryop // binary operator to query -) ; -GrB_Info GxB_BinaryOp_ytype_name // return the type_name of y -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_BinaryOp binaryop // binary operator to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_BinaryOp_ztype (GrB_Type *ztype, GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_ztype_name (char *type_name, const GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_xtype (GrB_Type *xtype, GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_xtype_name (char *type_name, const GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_ytype (GrB_Type *ytype, GrB_BinaryOp op) ; +GrB_Info GxB_BinaryOp_ytype_name (char *type_name, const GrB_BinaryOp op) ; GrB_Info GrB_BinaryOp_free // free a user-created binary operator ( @@ -1541,8 +1418,7 @@ GrB_Info GrB_BinaryOp_free // free a user-created binary operator // GxB_SelectOp: select operators (DEPRECATED: do not use) //============================================================================== -// GrB_select and GrB_IndexUnaryOp should be used instead of GxB_select. - +// historical; use GrB_select and GrB_IndexUnaryOp instead: typedef struct GB_SelectOp_opaque *GxB_SelectOp ; 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, @@ -1569,12 +1445,9 @@ typedef void (*GxB_index_unary_function) const void *y // input scalar y ) ; -// GrB_IndexUnaryOp_new creates a user-defined unary op, with an automatic -// detection of the operator name. -#undef GrB_IndexUnaryOp_new -#undef GrM_IndexUnaryOp_new +// GrB_IndexUnaryOp_new creates a user-defined unary op (no name or defn) -GrB_Info GRB (IndexUnaryOp_new) // create a new user-defined IndexUnary op +GrB_Info GrB_IndexUnaryOp_new // create a new user-defined IndexUnary op ( GrB_IndexUnaryOp *op, // handle for the new IndexUnary operator GxB_index_unary_function function, // pointer to IndexUnary function @@ -1583,11 +1456,6 @@ GrB_Info GRB (IndexUnaryOp_new) // create a new user-defined IndexUnary op GrB_Type ytype // type of input y (the scalar) ) ; -#define GrB_IndexUnaryOp_new(op,f,z,x,y) \ - GxB_IndexUnaryOp_new(op,f,z,x,y, GB_STR(f), NULL) -#define GrM_IndexUnaryOp_new(op,f,z,x,y) \ - GxM_IndexUnaryOp_new(op,f,z,x,y, GB_STR(f), NULL) - GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp ( GrB_IndexUnaryOp *op, // handle for the new IndexUnary operator @@ -1599,26 +1467,10 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp const char *idxop_defn // definition of the user function ) ; -GrB_Info GxB_IndexUnaryOp_ztype_name // return the type_name of z -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_IndexUnaryOp op // IndexUnary operator -) ; - -// For TRIL, TRIU, DIAG, OFFDIAG, COLLE, COLGT, ROWLE, and ROWGT, -// the xtype_name is an empty string (""), since these functions do not depend -// on the type of the matrix input. -GrB_Info GxB_IndexUnaryOp_xtype_name // return the type_name of x -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_IndexUnaryOp op // select operator -) ; - -GrB_Info GxB_IndexUnaryOp_ytype_name // return the type_name of the scalary y -( - char *type_name, // user array of size GxB_MAX_NAME_LEN - const GrB_IndexUnaryOp op // select operator -) ; +// historical; use GrB_get instead: +GrB_Info GxB_IndexUnaryOp_ztype_name (char *, const GrB_IndexUnaryOp op) ; +GrB_Info GxB_IndexUnaryOp_xtype_name (char *, const GrB_IndexUnaryOp op) ; +GrB_Info GxB_IndexUnaryOp_ytype_name (char *, const GrB_IndexUnaryOp op) ; GrB_Info GrB_IndexUnaryOp_free // free a user-created IndexUnaryOp ( @@ -1820,14 +1672,12 @@ GrB_Info GrB_Monoid_new_UDT // create a monoid with a user-defined type // Type-generic method for creating a new monoid: /* - 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 ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -1960,7 +1810,6 @@ GrB_Info GxB_Monoid_terminal_new_UDT // create a monoid with a user type // Type-generic method for creating a new monoid with a terminal value: /* - GrB_Info GxB_Monoid_terminal_new // create a monoid ( GrB_Monoid *monoid, // handle of monoid to create @@ -1968,7 +1817,6 @@ GrB_Info GxB_Monoid_terminal_new // create a monoid identity, // identity value of the monoid terminal // terminal value of the monoid ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -1981,25 +1829,10 @@ GrB_Info GxB_Monoid_terminal_new // create a monoid (monoid, op, identity, terminal) #endif -GrB_Info GxB_Monoid_operator // return the monoid operator -( - GrB_BinaryOp *op, // returns the binary op of the monoid - GrB_Monoid monoid // monoid to query -) ; - -GrB_Info GxB_Monoid_identity // return the monoid identity -( - void *identity, // returns the identity of the monoid - GrB_Monoid monoid // monoid to query -) ; - -GrB_Info GxB_Monoid_terminal // return the monoid terminal -( - bool *has_terminal, // true if the monoid has a terminal value - void *terminal, // returns the terminal of the monoid, - // unmodified if has_terminal is false - GrB_Monoid monoid // monoid to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Monoid_operator (GrB_BinaryOp *op, GrB_Monoid monoid) ; +GrB_Info GxB_Monoid_identity (void *identity, GrB_Monoid monoid) ; +GrB_Info GxB_Monoid_terminal (bool *, void *terminal, GrB_Monoid monoid) ; GrB_Info GrB_Monoid_free // free a user-created monoid ( @@ -2019,17 +1852,9 @@ GrB_Info GrB_Semiring_new // create a semiring GrB_BinaryOp multiply // multiply operator of the semiring ) ; -GrB_Info GxB_Semiring_add // return the add monoid of a semiring -( - GrB_Monoid *add, // returns add monoid of the semiring - GrB_Semiring semiring // semiring to query -) ; - -GrB_Info GxB_Semiring_multiply // return multiply operator of a semiring -( - GrB_BinaryOp *multiply, // returns multiply operator of the semiring - GrB_Semiring semiring // semiring to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Semiring_add (GrB_Monoid *add, GrB_Semiring semiring) ; +GrB_Info GxB_Semiring_multiply (GrB_BinaryOp *multiply, GrB_Semiring semiring) ; GrB_Info GrB_Semiring_free // free a user-created semiring ( @@ -2040,9 +1865,6 @@ GrB_Info GrB_Semiring_free // free a user-created semiring // GrB_Scalar: a GraphBLAS scalar //============================================================================== -// GxB_Scalar has become GrB_Scalar. The older name GxB_Scalar is kept as -// historical, but GrB_Scalar should be used instead. - typedef struct GB_Scalar_opaque *GxB_Scalar ; // historical: use GrB_Scalar typedef struct GB_Scalar_opaque *GrB_Scalar ; // use this instead @@ -2072,18 +1894,9 @@ GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar const GrB_Scalar s // GrB_Scalar to query ) ; -// NOTE: GxB_Scalar_type is historical. Use GxB_Scalar_type_name instead. -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 -) ; -GrB_Info GxB_Scalar_type_name // return the name of the type of a scalar -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Scalar s // GrB_Scalar to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Scalar_type (GrB_Type *type, const GrB_Scalar s) ; +GrB_Info GxB_Scalar_type_name (char *type_name, const GrB_Scalar s) ; GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar ( @@ -2212,13 +2025,11 @@ GrB_Info GxB_Scalar_setElement_UDT (GrB_Scalar s, void *x) ; // user-defined type. /* - GrB_Info GrB_Scalar_setElement // s = x ( GrB_Scalar s, // GrB_Scalar to modify x // user scalar to assign to s ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -2230,6 +2041,7 @@ GrB_Info GrB_Scalar_setElement // s = x ) \ (s, x) +// historical; use GrB_Scalar_setElement instead: #define GxB_Scalar_setElement(s,x) GrB_Scalar_setElement (s, x) #endif @@ -2360,6 +2172,7 @@ GrB_Info GrB_Scalar_extractElement // x = s ) \ (x, s) +// historical; use GrB_Scalar_extractElement instead: #define GxB_Scalar_extractElement(x,s) GrB_Scalar_extractElement (x, s) #endif @@ -2403,18 +2216,9 @@ GrB_Info GrB_Vector_nvals // get the number of entries in a vector const GrB_Vector v // vector to query ) ; -// NOTE: GxB_Vector_type is historical. Use GxB_Vector_type_name instead. -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 -) ; -GrB_Info GxB_Vector_type_name // return the name of the type of a vector -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Vector v // vector to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Vector_type (GrB_Type *type, const GrB_Vector v) ; +GrB_Info GxB_Vector_type_name (char *type_name, const GrB_Vector v) ; GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector ( @@ -2578,7 +2382,6 @@ GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples // for a user-defined type. /* - GrB_Info GrB_Vector_build // build a vector from (I,X) tuples ( GrB_Vector w, // vector to build @@ -2587,7 +2390,6 @@ GrB_Info GrB_Vector_build // build a vector from (I,X) tuples GrB_Index nvals, // number of tuples const GrB_BinaryOp dup // binary function to assemble duplicates ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -2716,14 +2518,12 @@ GrB_Info GrB_Vector_setElement_Scalar // w(i) = x // user-defined type. /* - GrB_Info GrB_Vector_setElement // w(i) = x ( GrB_Vector w, // vector to modify x, // scalar to assign to w(i) GrB_Index i // row index ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -2853,14 +2653,12 @@ GrB_Info GrB_Vector_extractElement_Scalar // x = v(i) // for a user-defined type. /* - GrB_Info GrB_Vector_extractElement // x = v(i) ( *x, // scalar extracted const GrB_Vector v, // vector to extract an entry from GrB_Index i // row index ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -3021,7 +2819,6 @@ GrB_Info GrB_Vector_extractTuples_UDT // [I,~,X] = find (v) // for a user-defined type. /* - GrB_Info GrB_Vector_extractTuples // [I,~,X] = find (v) ( GrB_Index *Ilist, // array for returning row indices of tuples @@ -3029,11 +2826,10 @@ GrB_Info GrB_Vector_extractTuples // [I,~,X] = find (v) GrB_Index *nvals, // I, X size on input; # tuples on output const GrB_Vector v // vector to extract tuples from ) ; - */ #if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_extractTuples(Ilist,X,nvals,v) \ +#define GrB_Vector_extractTuples(Ilist,X,nvals,v) \ _Generic \ ( \ (X), \ @@ -3088,18 +2884,9 @@ GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix const GrB_Matrix A // matrix to query ) ; -// NOTE: GxB_Matrix_type is historical. Use GxB_Matrix_type_name instead. -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 -) ; -GrB_Info GxB_Matrix_type_name // return the name of the type of a matrix -( - char *type_name, // name of the type (char array of size at least - // GxB_MAX_NAME_LEN, owned by the user application). - const GrB_Matrix A // matrix to query -) ; +// historical; use GrB_get instead: +GrB_Info GxB_Matrix_type (GrB_Type *type, const GrB_Matrix A) ; +GrB_Info GxB_Matrix_type_name (char *type_name, const GrB_Matrix A) ; GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix ( @@ -3128,7 +2915,7 @@ GrB_Info GrB_Matrix_free // free a matrix GrB_Info GrB_Matrix_build_BOOL // 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 *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 @@ -3138,7 +2925,7 @@ GrB_Info GrB_Matrix_build_BOOL // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_INT8 // 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 *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 @@ -3148,7 +2935,7 @@ GrB_Info GrB_Matrix_build_INT8 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_UINT8 // 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 *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 @@ -3158,7 +2945,7 @@ GrB_Info GrB_Matrix_build_UINT8 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_INT16 // 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 *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 @@ -3168,7 +2955,7 @@ GrB_Info GrB_Matrix_build_INT16 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_UINT16 // 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 *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 @@ -3178,7 +2965,7 @@ GrB_Info GrB_Matrix_build_UINT16 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_INT32 // 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 *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 @@ -3188,7 +2975,7 @@ GrB_Info GrB_Matrix_build_INT32 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_UINT32 // 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 *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 @@ -3198,7 +2985,7 @@ GrB_Info GrB_Matrix_build_UINT32 // build a matrix from (I,J,X) tuples 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 *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 @@ -3208,7 +2995,7 @@ GrB_Info GrB_Matrix_build_INT64 // build a matrix from (I,J,X) tuples 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 *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 @@ -3218,7 +3005,7 @@ GrB_Info GrB_Matrix_build_UINT64 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_FP32 // 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 *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 @@ -3228,7 +3015,7 @@ GrB_Info GrB_Matrix_build_FP32 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_FP64 // 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 *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 @@ -3238,7 +3025,7 @@ GrB_Info GrB_Matrix_build_FP64 // build a matrix from (I,J,X) tuples 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 *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 @@ -3248,7 +3035,7 @@ GrB_Info GxB_Matrix_build_FC32 // build a matrix from (I,J,X) tuples GrB_Info GxB_Matrix_build_FC64 // 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 *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 @@ -3258,7 +3045,7 @@ GrB_Info GxB_Matrix_build_FC64 // build a matrix from (I,J,X) tuples GrB_Info GrB_Matrix_build_UDT // 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 *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 @@ -3268,7 +3055,7 @@ GrB_Info GrB_Matrix_build_UDT // build a matrix from (I,J,X) tuples 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 *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 @@ -3278,21 +3065,19 @@ GrB_Info GxB_Matrix_build_Scalar // build a matrix from (I,J,scalar) tuples // for a user-defined type. /* - 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 *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 ) ; - */ #if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_build(C,Ilist,J,X,nvals,dup) \ +#define GrB_Matrix_build(C,Ilist,J,X,nvals,dup) \ _Generic \ ( \ (X), \ @@ -3432,7 +3217,6 @@ GrB_Info GrB_Matrix_setElement_Scalar // C (i,j) = x // user-defined type. /* - GrB_Info GrB_Matrix_setElement // C (i,j) = x ( GrB_Matrix C, // matrix to modify @@ -3440,7 +3224,6 @@ GrB_Info GrB_Matrix_setElement // C (i,j) = x GrB_Index i, // row index GrB_Index j // column index ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -3585,7 +3368,6 @@ GrB_Info GrB_Matrix_extractElement_Scalar // x = A(i,j) // for a user-defined type. /* - GrB_Info GrB_Matrix_extractElement // x = A(i,j) ( *x, // extracted scalar @@ -3593,7 +3375,6 @@ GrB_Info GrB_Matrix_extractElement // x = A(i,j) GrB_Index i, // row index GrB_Index j // column index ) ; - */ #if GxB_STDC_VERSION >= 201112L @@ -3770,7 +3551,6 @@ GrB_Info GrB_Matrix_extractTuples_UDT // [I,J,X] = find (A) // 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 @@ -3779,7 +3559,6 @@ GrB_Info GrB_Matrix_extractTuples // [I,J,X] = find (A) 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 @@ -3819,7 +3598,7 @@ GrB_Info GrB_Matrix_extractTuples // [I,J,X] = find (A) // 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 GxB_Matrix_Option_set (format by row +// 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. @@ -3877,7 +3656,7 @@ GrB_Info GrB_Matrix_diag // build a diagonal matrix from a vector // 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 GxB_Matrix_Option_set (format by row or by column, bitmap switch, hyper +// 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 @@ -3902,7 +3681,7 @@ GrB_Info GxB_Matrix_diag // construct a diagonal matrix from a vector // 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 -// GxB_Vector_Option_set (bitmap switch and sparsity control) are unchanged. +// GrB_set (bitmap switch and sparsity control) are unchanged. GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector ( @@ -3917,60 +3696,58 @@ GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector //============================================================================== // The following options modify how SuiteSparse:GraphBLAS stores and operates -// on its matrices. The GxB_*Option* methods allow the user to suggest how the +// 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. -// GxB_Matrix_Option_set: sets an option for a specific matrix -// GxB_Matrix_Option_get: queries the current option of a specific matrix -// GxB_Vector_Option_set: sets an option for a specific vector -// GxB_Vector_Option_get: queries the current option of a specific vector -// GxB_Global_Option_set: sets an option for all future matrices -// GxB_Global_Option_get: queries current option for all future matrices - typedef enum // for global options or matrix options { //------------------------------------------------------------ - // for GxB_Matrix_Option_get/set and GxB_Global_Option_get/set: + // 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) - GxB_FORMAT = 7002, // CSR/CSC format: GxB_BY_ROW or GxB_BY_COL + GxB_FORMAT = 7002, // historical; use GrB_STORAGE_ORIENTATION_HINT //------------------------------------------------------------ - // for GxB_Global_Option_get only: + // GrB_get for GrB_GLOBAL: //------------------------------------------------------------ - GxB_MODE = 7003, // mode passed to GrB_init - GxB_LIBRARY_NAME = 7004, // name of the library (char *) - GxB_LIBRARY_VERSION = 7005, // library version (3 int's) + GxB_MODE = 7003, // historical; use GrB_BLOCKING_MODE + GxB_LIBRARY_NAME = 7004, // historical; use GrB_NAME + GxB_LIBRARY_VERSION = 7005, // historical; use GrB_LIBRARY_VER_* 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_VERSION = 7012, // API version (3 int's) + GxB_API_VERSION = 7012, // historical; use GrB_API_VER_* 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 //------------------------------------------------------------ - // for GxB_Global_Option_get/set only: + // 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_GLOBAL_GPU_ID = GxB_GPU_ID, // which GPU to use (DRAFT) - GxB_BURBLE = 7019, // diagnostic output (bool *) + GxB_BURBLE = 7019, // diagnostic output GxB_PRINTF = 7020, // printf function diagnostic output GxB_FLUSH = 7021, // flush function diagnostic output GxB_MEMORY_POOL = 7022, // no longer used @@ -3988,27 +3765,18 @@ typedef enum // for global options or matrix options GxB_JIT_ERROR_LOG = 7033, // CPU JIT: error log file //------------------------------------------------------------ - // for GxB_Matrix_Option_get only: + // 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 //------------------------------------------------------------ - // for GxB_Matrix_Option_get/set only: + // GrB_get/GrB_set for GrB_Matrix: //------------------------------------------------------------ GxB_SPARSITY_CONTROL = 7036, // sparsity control: 0 to 15; see below - //------------------------------------------------------------ - // memory functions (GxB_Global_Option_get only): - //------------------------------------------------------------ - - GxB_MALLOC_FUNCTION = 7037, - GxB_CALLOC_FUNCTION = 7038, - GxB_REALLOC_FUNCTION = 7039, - GxB_FREE_FUNCTION = 7040, - } GxB_Option_Field ; // for GxB_JIT_C_CONTROL: @@ -4022,7 +3790,7 @@ typedef enum } GxB_JIT_Control ; -// GxB_FORMAT can be by row or by column: +// GxB_FORMAT is historical, but it can be by row or by column: typedef enum { GxB_BY_ROW = 0, // CSR: compressed sparse row format @@ -4055,7 +3823,7 @@ GB_GLOBAL const double GxB_HYPER_DEFAULT ; // the default sparsity control is any format: #define GxB_AUTO_SPARSITY GxB_ANY_SPARSITY -// GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, scontrol) provides hints +// GrB_set (A, scontrol, GxB_SPARSITY_CONTROL) provides hints // about which data structure GraphBLAS should use for the matrix A: // // GxB_AUTO_SPARSITY: GraphBLAS selects automatically. @@ -4078,11 +3846,11 @@ GB_GLOBAL const double GxB_HYPER_DEFAULT ; // formats can be bitwise negated. For example, to allow for any format // except full, use ~GxB_FULL. // -// GxB_Matrix_Option_get (A, GxB_SPARSITY_STATUS, &sparsity) returns the +// GrB_get (A, &sparsity, GxB_SPARSITY_STATUS) returns the // current data structure currently used for the matrix A (either hypersparse, // sparse, bitmap, or full). // -// GxB_Matrix_Option_get (A, GxB_SPARSITY_CONTROL, &scontrol) returns the hint +// GrB_get (A, &scontrol, GxB_SPARSITY_CONTROL) returns the hint // for how A should be stored (hypersparse, sparse, bitmap, or full, or any // combination). @@ -4113,183 +3881,6 @@ GB_GLOBAL const double GxB_HYPER_DEFAULT ; GB_GLOBAL const double GxB_ALWAYS_HYPER, GxB_NEVER_HYPER ; -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 - ... // value to change it to -) ; - -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 - int32_t value // value to change it to -) ; - -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 - double value // value to change it to -) ; - -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 - ... // return value of the matrix option -) ; - -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 - int32_t *value // return value of the matrix option -) ; - -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 - double *value // return value of the matrix option -) ; - -GrB_Info GxB_Vector_Option_set // set an option in a vector -( - GrB_Vector A, // vector to modify - GxB_Option_Field field, // option to change - ... // value to change it to -) ; - -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 - int32_t value // value to change it to -) ; - -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 - double value // value to change it to -) ; - -GrB_Info GxB_Vector_Option_get // gets the current option of a vector -( - GrB_Vector A, // vector to query - GxB_Option_Field field, // option to query - ... // return value of the vector option -) ; - -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 - int32_t *value // return value of the vector option -) ; - -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 - double *value // return value of the vector option -) ; - -// GxB_Global_Option_set controls the global defaults used when a new matrix is -// created. GrB_init defines the following initial settings: -// -// GxB_Global_Option_set (GxB_HYPER_SWITCH, GxB_HYPER_DEFAULT) ; -// GxB_Global_Option_set (GxB_BITMAP_SWITCH, NULL) ; -// GxB_Global_Option_set (GxB_FORMAT, GxB_FORMAT_DEFAULT) ; -// -// The compile-time constants GxB_HYPER_DEFAULT and GxB_FORMAT_DEFAULT are -// equal to 0.0625 and GxB_BY_ROW, by default. That is, by default, all new -// matrices are held by row in CSR format. If a matrix has fewer than n/16 -// columns, it can be converted to hypersparse structure. If it has more than -// n/8 columns, it can be converted to a sparse structure. Modifying these -// global settings via GxB_Global_Option_set has no effect on matrices already -// created. - -GrB_Info GxB_Global_Option_set // set a global default option -( - GxB_Option_Field field, // option to change - ... // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_INT32 // set a global default option -( - GxB_Option_Field field, // option to change - int32_t value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_FP64 // set a global default option -( - GxB_Option_Field field, // option to change - double value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_FP64_ARRAY // set a global default option -( - GxB_Option_Field field, // option to change - double *value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_INT64_ARRAY // set a global default option -( - GxB_Option_Field field, // option to change - int64_t *value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_CHAR // set a global default option -( - GxB_Option_Field field, // option to change - const char *value // value to change it to -) ; - -GrB_Info GxB_Global_Option_set_FUNCTION // set a global default option -( - GxB_Option_Field field, // option to change - void *value // value to change it to -) ; - -GrB_Info GxB_Global_Option_get // gets the current global default option -( - GxB_Option_Field field, // option to query - ... // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_INT32 // gets the current global option -( - GxB_Option_Field field, // option to query - int32_t *value // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_FP64 // gets the current global option -( - GxB_Option_Field field, // option to query - double *value // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_INT64 // gets the current global option -( - GxB_Option_Field field, // option to query - int64_t *value // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_CHAR // gets the current global option -( - GxB_Option_Field field, // option to query - const char **value // return value of the global option -) ; - -GrB_Info GxB_Global_Option_get_FUNCTION // gets the current global option -( - GxB_Option_Field field, // option to query - void **value // return value of the global option -) ; - //============================================================================== // GxB_Context: for managing computational resources //============================================================================== @@ -4322,48 +3913,6 @@ GrB_Info GxB_Context_free // free a Context GxB_Context *Context // handle of Context to free ) ; -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 - int32_t value // value to change it to -) ; - -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 - double value // value to change it to -) ; - -GrB_Info GxB_Context_set // set a parameter in a Context -( - GxB_Context Context, // Context to modify - GxB_Context_Field field, // parameter to change - ... // value to change it to -) ; - -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 - int32_t *value // return value from the 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 - double *value // return value from the 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 - ... // return value of the descriptor -) ; - GrB_Info GxB_Context_engage // engage a Context ( GxB_Context Context // Context to engage @@ -4375,152 +3924,41 @@ GrB_Info GxB_Context_disengage // disengage a Context ) ; //============================================================================== -// GxB_set and GxB_get +// GxB_set and GxB_get: historical; use GrB_set and GrB_get instead //============================================================================== -// The simplest way to set/get a value of a GrB_Descriptor is with -// the generic GxB_set and GxB_get functions: - -// GxB_set (desc, field, value) ; -// GxB_get (desc, field, &value) ; - -// GxB_set and GxB_get are generic methods that and set or query the options in -// a GrB_Matrix, a GrB_Descriptor, or in the global options. They can be used -// with the following syntax. - -// To set/get the global options: -// -// GxB_set (GxB_HYPER_SWITCH, double h) ; -// GxB_set (GxB_HYPER_SWITCH, GxB_ALWAYS_HYPER) ; -// GxB_set (GxB_HYPER_SWITCH, GxB_NEVER_HYPER) ; -// GxB_get (GxB_HYPER_SWITCH, double *h) ; -// -// double b [GxB_NBITMAP_SWITCH] ; -// GxB_set (GxB_BITMAP_SWITCH, b) ; -// GxB_set (GxB_BITMAP_SWITCH, NULL) ; // set defaults -// GxB_get (GxB_BITMAP_SWITCH, b) ; -// -// GxB_set (GxB_FORMAT, GxB_BY_ROW) ; -// GxB_set (GxB_FORMAT, GxB_BY_COL) ; -// GxB_get (GxB_FORMAT, GxB_Format_Value *s) ; -// -// GxB_set (GxB_NTHREADS, nthreads_max) ; -// GxB_get (GxB_NTHREADS, int *nthreads_max) ; -// -// GxB_set (GxB_CHUNK, double chunk) ; -// GxB_get (GxB_CHUNK, double *chunk) ; -// -// GxB_set (GxB_BURBLE, bool burble) ; -// GxB_get (GxB_BURBLE, bool *burble) ; -// -// GxB_set (GxB_PRINTF, void *printf_function) ; -// GxB_get (GxB_PRINTF, void **printf_function) ; -// -// GxB_set (GxB_FLUSH, void *flush_function) ; -// GxB_get (GxB_FLUSH, void **flush_function) ; - -// GxB_set (GxB_JIT_C_COMPILER_NAME, const char *compiler) ; -// GxB_get (GxB_JIT_C_COMPILER_NAME, const char **compiler) ; -// GxB_set (GxB_JIT_C_COMPILER_FLAGS, const char *flags) ; -// GxB_get (GxB_JIT_C_COMPILER_FLAGS, const char **flags) ; -// GxB_set (GxB_JIT_C_LINKER_FLAGS, const char *flags) ; -// GxB_get (GxB_JIT_C_LINKER_FLAGS, const char **flags) ; -// GxB_set (GxB_JIT_CACHE_PATH, const char *cache_path) ; -// GxB_get (GxB_JIT_CACHE_PATH, const char **cache_path) ; -// GxB_set (GxB_JIT_C_CONTROL, int control) ; -// GxB_get (GxB_JIT_C_CONTROL, int *control) ; - -// To set/get the GxB_CONTEXT_WORLD options: These have the same effect as -// the global set/get for NTHREADS and CHUNK, listed above. -// -// GxB_set (GxB_CONTEXT_WORLD, GxB_NTHREADS, nthreads_max) ; -// GxB_get (GxB_CONTEXT_WORLD, GxB_NTHREADS, int *nthreads_max) ; -// -// GxB_set (GxB_CONTEXT_WORLD, GxB_CHUNK, double chunk) ; -// GxB_get (GxB_CONTEXT_WORLD, GxB_CHUNK, double *chunk) ; - -// To set/get a Context option: -// -// GxB_set (GxB_Context Context, GxB_NTHREADS, nthreads_max) ; -// GxB_get (GxB_Context Context, GxB_NTHREADS, int *nthreads_max) ; -// -// GxB_set (GxB_Context Context, GxB_CHUNK, double chunk) ; -// GxB_get (GxB_Context Context, GxB_CHUNK, double *chunk) ; - -// To get global options that can be queried but not modified: -// -// GxB_get (GxB_MODE, GrB_Mode *mode) ; - -// To set/get a matrix option: -// -// GxB_set (GrB_Matrix A, GxB_HYPER_SWITCH, double h) ; -// GxB_set (GrB_Matrix A, GxB_HYPER_SWITCH, GxB_ALWAYS_HYPER) ; -// GxB_set (GrB_Matrix A, GxB_HYPER_SWITCH, GxB_NEVER_HYPER) ; -// GxB_get (GrB_Matrix A, GxB_HYPER_SWITCH, double *h) ; -// -// GxB_set (GrB_Matrix A, GxB_BITMAP_SWITCH, double b) ; -// GxB_get (GrB_Matrix A, GxB_BITMAP_SWITCH, double *b) ; -// -// GxB_set (GrB_Matrix A, GxB_FORMAT, GxB_BY_ROW) ; -// GxB_set (GrB_Matrix A, GxB_FORMAT, GxB_BY_COL) ; -// GxB_get (GrB_Matrix A, GxB_FORMAT, GxB_Format_Value *s) ; -// -// GxB_set (GrB_Matrix A, GxB_SPARSITY_CONTROL, GxB_AUTO_SPARSITY) ; -// GxB_set (GrB_Matrix A, GxB_SPARSITY_CONTROL, scontrol) ; -// GxB_get (GrB_Matrix A, GxB_SPARSITY_CONTROL, int *scontrol) ; -// -// GxB_get (GrB_Matrix A, GxB_SPARSITY_STATUS, int *sparsity) ; - -// To set/get a vector option or status: -// -// GxB_set (GrB_Vector v, GxB_BITMAP_SWITCH, double b) ; -// GxB_get (GrB_Vector v, GxB_BITMAP_SWITCH, double *b) ; -// -// GxB_set (GrB_Vector v, GxB_FORMAT, GxB_BY_ROW) ; -// GxB_set (GrB_Vector v, GxB_FORMAT, GxB_BY_COL) ; -// GxB_get (GrB_Vector v, GxB_FORMAT, GxB_Format_Value *s) ; -// -// GxB_set (GrB_Vector v, GxB_SPARSITY_CONTROL, GxB_AUTO_SPARSITY) ; -// GxB_set (GrB_Vector v, GxB_SPARSITY_CONTROL, scontrol) ; -// GxB_get (GrB_Vector v, GxB_SPARSITY_CONTROL, int *scontrol) ; -// -// GxB_get (GrB_Vector v, GxB_SPARSITY_STATUS, int *sparsity) ; - -// To set/get a descriptor field: -// -// GxB_set (GrB_Descriptor d, GrB_OUTP, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GrB_OUTP, GrB_REPLACE) ; -// GxB_get (GrB_Descriptor d, GrB_OUTP, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GrB_MASK, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GrB_MASK, GrB_COMP) ; -// GxB_set (GrB_Descriptor d, GrB_MASK, GrB_STRUCTURE) ; -// GxB_set (GrB_Descriptor d, GrB_MASK, GrB_COMP + GrB_STRUCTURE) ; -// GxB_get (GrB_Descriptor d, GrB_MASK, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GrB_INP0, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GrB_INP0, GrB_TRAN) ; -// GxB_get (GrB_Descriptor d, GrB_INP0, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GrB_INP1, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GrB_INP1, GrB_TRAN) ; -// GxB_get (GrB_Descriptor d, GrB_INP1, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_DEFAULT) ; -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_GUSTAVSON) ; -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_HASH) ; -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_SAXPY) ; -// GxB_set (GrB_Descriptor d, GxB_AxB_METHOD, GxB_AxB_DOT) ; -// GxB_get (GrB_Descriptor d, GrB_AxB_METHOD, GrB_Desc_Value *v) ; -// -// GxB_set (GrB_Descriptor d, GxB_SORT, int sort) ; -// GxB_get (GrB_Descriptor d, GxB_SORT, int *sort) ; -// -// GxB_set (GrB_Descriptor d, GxB_COMPRESSION, int method) ; -// GxB_get (GrB_Descriptor d, GxB_COMPRESSION, int *method) ; -// -// GxB_set (GrB_Descriptor d, GxB_IMPORT, int method) ; -// GxB_get (GrB_Descriptor d, GxB_IMPORT, int *method) ; +// historical: use GrB_set and GrB_get instead of these methods: +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, ...) ; #if GxB_STDC_VERSION >= 201112L #define GxB_set(arg1,...) \ @@ -4550,6 +3988,518 @@ GrB_Info GxB_Context_disengage // disengage a Context (arg1, __VA_ARGS__) #endif +//============================================================================== +// 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, and GrB_IndexUnaryOp: + 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_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 ; + +//------------------------------------------------------------------------------ +// 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 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 \ + ) , \ + 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__) + +//------------------------------------------------------------------------------ +// 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 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 \ + ) , \ + 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 + +#endif + //============================================================================== // GrB_free: free any GraphBLAS object //============================================================================== @@ -5023,7 +4973,7 @@ GrB_Info GrB_Vector_extract // w = accum (w, u(I)) 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 + const GrB_Index *Ilist, // row indices GrB_Index ni, // number of row indices const GrB_Descriptor desc // descriptor for w and mask ) ; @@ -5034,7 +4984,7 @@ GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) 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 + 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 @@ -5047,7 +4997,7 @@ GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) 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 + 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 @@ -9237,6 +9187,11 @@ GrB_Info GxB_Context_fprint // print and check a GxB_Context FILE *f // file for output ) ; +// user code should not directly use GB_STR or GB_XSTR +// GB_STR: convert the content of x into a string "x" +#define GB_XSTR(x) GB_STR(x) +#define GB_STR(x) #x + #if GxB_STDC_VERSION >= 201112L #define GxB_fprint(object,pr,f) \ _Generic \ @@ -10791,7 +10746,7 @@ GrB_Info GrB_Matrix_exportHint // suggest the best export format fread (blob, sizeof (uint8_t), blob_size, f) ; fclose (f) ; char type_name [GxB_MAX_NAME_LEN] ; - GxB_deserialize_type_name (type_name, blob, blob_size) ; + GrB_get (blob, type_name, GxB_JIT_C_NAME, blob_size) ; printf ("blob type is: %s\n", type_name) ; GrB_Type user_type = NULL ; if (strncmp (type_name, "myquaternion", GxB_MAX_NAME_LEN) == 0) @@ -10946,23 +10901,8 @@ GrB_Info GxB_Vector_deserialize // deserialize blob into a GrB_Vector const GrB_Descriptor desc // to control # of threads used ) ; -// GxB_deserialize_type_name extracts the type_name of the GrB_Type of the -// GrB_Matrix or GrB_Vector held in a serialized blob. On input, type_name -// must point to a user-owned char array of size at least GxB_MAX_NAME_LEN (it -// must not point into the blob itself). On output, type_name will contain a -// null-terminated string with the corresponding C type name. If the blob -// holds a matrix of a built-in type, the name is returned as "bool" for -// GrB_BOOL, "uint8_t" for GrB_UINT8, "float complex" for GxB_FC32, etc. -// See GxB_Type_name to convert this name into a GrB_Type. -GrB_Info GxB_deserialize_type_name // return the type name of a blob -( - // output: - char *type_name, // name of the type (char array of size at least - // 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 -) ; +// historical; use GrB_get with GxB_JIT_C_NAME instead. +GrB_Info GxB_deserialize_type_name (char *, const void *, GrB_Index) ; //============================================================================== // GxB_Vector_sort and GxB_Matrix_sort: sort a matrix or vector diff --git a/GraphBLAS/JITpackage/Source/grb_jitpackage.c b/GraphBLAS/JITpackage/Source/grb_jitpackage.c index 27a8ad9499..429c53f08f 100644 --- a/GraphBLAS/JITpackage/Source/grb_jitpackage.c +++ b/GraphBLAS/JITpackage/Source/grb_jitpackage.c @@ -16,7 +16,9 @@ //------------------------------------------------------------------------------ // ZSTD uses switch statements with no default case. +#if defined (__GNUC__) #pragma GCC diagnostic ignored "-Wswitch-default" +#endif // disable ZSTD deprecation warnings and include all ZSTD definitions diff --git a/GraphBLAS/LICENSE b/GraphBLAS/LICENSE index ad991bd0e3..205d59d279 100644 --- a/GraphBLAS/LICENSE +++ b/GraphBLAS/LICENSE @@ -1,4 +1,4 @@ -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. The following Apache-2.0 applies to all of SuiteSparse:GraphBLAS, except for 3rd-party software: diff --git a/GraphBLAS/README.md b/GraphBLAS/README.md index f6ad2f6011..1d69e7ea44 100644 --- a/GraphBLAS/README.md +++ b/GraphBLAS/README.md @@ -1,10 +1,10 @@ # SuiteSparse:GraphBLAS -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 -VERSION 8.3.1, Dec 30, 2023 +VERSION 9.0.0, Jan 10, 2024 SuiteSparse:GraphBLAS is a complete implementation of the GraphBLAS standard, which defines a set of sparse matrix operations on an extended algebra of @@ -63,7 +63,7 @@ README.md file with further details. CMakeLists.txt: cmake instructions to compile GraphBLAS -cmake_modules: additional cmake files +`cmake_modules`: additional cmake files Config: version-dependent files used by CMake @@ -100,7 +100,7 @@ CUDA: GPU interface, a work in progress. This is being developed in CONTRIBUTOR-LICENSE.txt: how to contribute to SuiteSparse:GraphBLAS -cpu_features: (c) Google.com, Apache 2.0 license. +`cpu_features`: (c) Google.com, Apache 2.0 license. logo: the (awesome!) GraphBLAS logo by Jakab Rokob, CC BY 4.0 license @@ -108,7 +108,7 @@ lz4: LZ4 compression, (c) 2011-2016, Yann Collet, BSD2 license zstd: ZSTD compression, (c) Meta, by Yann Collet, BSD3 license xxHash: xxHash code, (c) 2012-2021, Yann Collet -rmm_wrap: Rapids Memory Manager, (c) NVIDIA, to use with CUDA. +`rmm_wrap`: Rapids Memory Manager, (c) NVIDIA, to use with CUDA. (draft; not yet in use) @@ -128,9 +128,9 @@ PreJIT: a folder for JIT kernels that are to be integrated into the Versions v5.2.0 and earlier conform to the version 1.3.0 (Sept 25, 2019) of the GraphBLAS C API Specification. Versions v6.0.0 and later conform to the -version 2.0.0 (Nov, 2021) of the GraphBLAS C API Specification. This library -also includes several additional functions and features as extensions to the -spec. +version 2.0.0 (Nov, 2021) of the GraphBLAS C API Specification. Versions +9.0.0 and later conform to the v2.1.0 C API. This library also includes +several additional functions and features as extensions to the spec. All functions, objects, and macros with the prefix GxB are extensions to the spec. Functions, objects, and macros with prefix GB must not be accessed @@ -196,7 +196,7 @@ To support the development of GraphBLAS, contact the author (davis@tamu.edu) or the Texas A&M Foundation (True Brown, tbrown@txamfoundation.com; or Kevin McGinnis, kmcginnis@txamfoundation.com) for details. -SuiteSparse:GraphBLAS, is copyrighted by Timothy A. Davis, (c) 2017-2023, All +SuiteSparse:GraphBLAS, is copyrighted by Timothy A. Davis, (c) 2017-2024, All Rights Reserved. davis@tamu.edu. ----------------------------------------------------------------------------- @@ -244,7 +244,7 @@ file, and in the GraphBLAS User Guide): (1) LZ4, xxHash, and ZSTD by Yann Collet, appearing here under the BSD2 or BSD3 licenses. -(2) cpu_features (c) Google, Apache 2.0 license with components (c) IBM and -Intel (also Apache 2.0), and the cpu_featurer/ndk_compat component (c) +(2) `cpu_features` (c) Google, Apache 2.0 license with components (c) IBM and +Intel (also Apache 2.0), and the `cpu_featurer/ndk_compat` component (c) The Android Open Source Project (BSD-2-clause) diff --git a/GraphBLAS/Source/Factories/GB_AxB_saxpy3_symbolic_template.c b/GraphBLAS/Source/Factories/GB_AxB_saxpy3_symbolic_template.c index ad0ce2f532..111d76e254 100644 --- a/GraphBLAS/Source/Factories/GB_AxB_saxpy3_symbolic_template.c +++ b/GraphBLAS/Source/Factories/GB_AxB_saxpy3_symbolic_template.c @@ -76,10 +76,10 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) ASSERT (GB_A_IS_FULL == GB_IS_FULL (A)) ; #if GB_A_IS_HYPER - const int64_t *restrict A_Yp = A->Y->p ; - const int64_t *restrict A_Yi = A->Y->i ; - const int64_t *restrict A_Yx = A->Y->x ; - int64_t A_hash_bits = A->Y->vdim - 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 ; + const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if ( !GB_NO_MASK ) @@ -95,18 +95,10 @@ 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 = NULL ; - const int64_t *restrict M_Yi = NULL ; - const int64_t *restrict M_Yx = NULL ; - int64_t M_hash_bits = 0 ; - if (M_is_hyper) - { - // mask is present, and hypersparse - M_Yp = M->Y->p ; - M_Yi = M->Y->i ; - M_Yx = M->Y->x ; - M_hash_bits = M->Y->vdim - 1 ; - } + 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 int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; #endif //========================================================================== diff --git a/GraphBLAS/Source/Factories/GB_Matrix_extractElement.c b/GraphBLAS/Source/Factories/GB_Matrix_extractElement.c index c6f29d2e18..ec6f71f1e7 100644 --- a/GraphBLAS/Source/Factories/GB_Matrix_extractElement.c +++ b/GraphBLAS/Source/Factories/GB_Matrix_extractElement.c @@ -103,27 +103,20 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = A(row,col) // A is hypersparse: look for j in hyperlist A->h [0 ... A->nvec-1] //------------------------------------------------------------------ - int64_t k ; - if (A->Y == NULL) - { - // A is hypersparse but does not yet have a hyper_hash - k = 0 ; - found = GB_lookup (true, Ah, Ap, A->vlen, &k, - A->nvec-1, j, &pA_start, &pA_end) ; - } - else - { - // A is hypersparse, with a hyper_hash that is already built - k = GB_hyper_hash_lookup (Ap, A->Y->p, A->Y->i, A->Y->x, - A->Y->vdim-1, j, &pA_start, &pA_end) ; - found = (k >= 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 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) ; + found = (k >= 0) ; if (!found) { // vector j is empty return (GrB_NO_VALUE) ; } ASSERT (j == Ah [k]) ; + } else { diff --git a/GraphBLAS/Source/Factories/GB_unop_factory.c b/GraphBLAS/Source/Factories/GB_unop_factory.c index 76aaf675c8..2fa00b037b 100644 --- a/GraphBLAS/Source/Factories/GB_unop_factory.c +++ b/GraphBLAS/Source/Factories/GB_unop_factory.c @@ -610,7 +610,7 @@ } break ; - case GB_FREXPX_unop_code : // z = frexpx (x), mantissa from ANSI C11 frexp + case GB_FREXPX_unop_code : // z = frexpx (x), mantissa from C11 frexp switch (code1) { @@ -620,7 +620,7 @@ } break ; - case GB_FREXPE_unop_code : // z = frexpe (x), exponent from ANSI C11 frexp + case GB_FREXPE_unop_code : // z = frexpe (x), exponent from C11 frexp switch (code1) { diff --git a/GraphBLAS/Source/GB_AxB_dot.c b/GraphBLAS/Source/GB_AxB_dot.c index 6d821a1c56..f43a4dc80e 100644 --- a/GraphBLAS/Source/GB_AxB_dot.c +++ b/GraphBLAS/Source/GB_AxB_dot.c @@ -188,9 +188,9 @@ GrB_Info GB_AxB_dot // dot product (multiple methods) #if defined ( GRAPHBLAS_HAS_CUDA ) if (!C_iso && // fixme for CUDA, remove and create C iso on output - GB_AxB_dot3_cuda_branch (M, Mask_struct, A, B, semiring, flipxy)) + GB_cuda_AxB_dot3_branch (M, Mask_struct, A, B, semiring, flipxy)) { - info = (GB_AxB_dot3_cuda (C, M, Mask_struct, A, B, semiring, + info = (GB_cuda_AxB_dot3_jit (C, M, Mask_struct, A, B, semiring, flipxy)) ; } else diff --git a/GraphBLAS/Source/GB_AxB_dot3.c b/GraphBLAS/Source/GB_AxB_dot3.c index 2ede234fa5..daf0cf0b68 100644 --- a/GraphBLAS/Source/GB_AxB_dot3.c +++ b/GraphBLAS/Source/GB_AxB_dot3.c @@ -146,17 +146,15 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method ASSERT (A->vlen == B->vlen) ; ASSERT (vlen > 0) ; - const GrB_Matrix A_Y = A->Y ; - const int64_t *restrict A_Yp = (A_is_hyper) ? A_Y->p : NULL ; - const int64_t *restrict A_Yi = (A_is_hyper) ? A_Y->i : NULL ; - const int64_t *restrict A_Yx = (A_is_hyper) ? A_Y->x : NULL ; - const int64_t A_hash_bits = (A_is_hyper) ? (A_Y->vdim - 1) : 0 ; - - const GrB_Matrix B_Y = B->Y ; - const int64_t *restrict B_Yp = (B_is_hyper) ? B_Y->p : NULL ; - const int64_t *restrict B_Yi = (B_is_hyper) ? B_Y->i : NULL ; - const int64_t *restrict B_Yx = (B_is_hyper) ? B_Y->x : NULL ; - const int64_t B_hash_bits = (B_is_hyper) ? (B_Y->vdim - 1) : 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 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 int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; //-------------------------------------------------------------------------- // allocate C, the same size and # of entries as M diff --git a/GraphBLAS/Source/GB_AxB_saxpy3_flopcount.c b/GraphBLAS/Source/GB_AxB_saxpy3_flopcount.c index a720ec64be..a514c72df7 100644 --- a/GraphBLAS/Source/GB_AxB_saxpy3_flopcount.c +++ b/GraphBLAS/Source/GB_AxB_saxpy3_flopcount.c @@ -147,7 +147,7 @@ GrB_Info GB_AxB_saxpy3_flopcount mnvec = M->nvec ; mvlen = M->vlen ; M_is_dense = GB_IS_BITMAP (M) || GB_as_if_full (M) ; - if (M_is_hyper) + if (M->Y != NULL) { // mask is present, and hypersparse ASSERT_MATRIX_OK (M->Y, "M->Y hyper_hash", GB0) ; @@ -167,19 +167,10 @@ GrB_Info GB_AxB_saxpy3_flopcount 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 = NULL ; - const int64_t *restrict A_Yi = NULL ; - const int64_t *restrict A_Yx = NULL ; - int64_t A_hash_bits = 0 ; - if (A_is_hyper) - { - ASSERT_MATRIX_OK (A->Y, "A->Y hyper_hash", GB0) ; - A_Yp = A->Y->p ; - A_Yi = A->Y->i ; - A_Yx = A->Y->x ; - A_hash_bits = A->Y->vdim - 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 ; + const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; const int64_t *restrict Bp = B->p ; const int64_t *restrict Bh = B->h ; @@ -279,8 +270,8 @@ 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 (Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, - j, &pM, &pM_end) ; + GB_hyper_hash_lookup (Mh, mnvec, Mp, M_Yp, M_Yi, M_Yx, + M_hash_bits, j, &pM, &pM_end) ; } else { @@ -329,8 +320,8 @@ 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 (Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, - k, &pA, &pA_end) ; + GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, + A_hash_bits, k, &pA, &pA_end) ; } else { diff --git a/GraphBLAS/Source/GB_AxB_saxpy3_slice_balanced.c b/GraphBLAS/Source/GB_AxB_saxpy3_slice_balanced.c index f6746a7c7d..61109d5d86 100644 --- a/GraphBLAS/Source/GB_AxB_saxpy3_slice_balanced.c +++ b/GraphBLAS/Source/GB_AxB_saxpy3_slice_balanced.c @@ -270,20 +270,12 @@ GrB_Info GB_AxB_saxpy3_slice_balanced 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 A_Yp = NULL ; - const int64_t *restrict A_Yi = NULL ; - const int64_t *restrict A_Yx = NULL ; - int64_t A_hash_bits = 0 ; - if (A_is_hyper) - { - ASSERT_MATRIX_OK (A->Y, "A->Y hyper_hash", GB0) ; - A_Yp = A->Y->p ; - A_Yi = A->Y->i ; - A_Yx = A->Y->x ; - A_hash_bits = A->Y->vdim - 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 ; + const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; const int64_t *restrict Bp = B->p ; const int64_t *restrict Bh = B->h ; @@ -304,8 +296,7 @@ GrB_Info GB_AxB_saxpy3_slice_balanced int64_t Mwork = 0 ; int64_t *restrict Bflops = C->p ; // use C->p as workspace for Bflops - GB_OK (GB_AxB_saxpy3_flopcount (&Mwork, Bflops, M, Mask_comp, A, B, - Werk)) ; + 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 ; GBURBLE ("axbwork %g ", axbflops) ; @@ -687,8 +678,8 @@ GrB_Info GB_AxB_saxpy3_slice_balanced if (A_is_hyper) { // A is hypersparse: find A(:,k) in hyper_hash - GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, k, &pA, &pA_end) ; + GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, + A_Yi, A_Yx, A_hash_bits, k, &pA, &pA_end) ; } else { diff --git a/GraphBLAS/Source/GB_BinaryOp_check.c b/GraphBLAS/Source/GB_BinaryOp_check.c index 609d9d0ad0..2e70527802 100644 --- a/GraphBLAS/Source/GB_BinaryOp_check.c +++ b/GraphBLAS/Source/GB_BinaryOp_check.c @@ -60,26 +60,29 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator bool op_is_first = (opcode == GB_FIRST_binop_code) ; bool op_is_second = (opcode == GB_SECOND_binop_code) ; bool op_is_pair = (opcode == GB_PAIR_binop_code) ; + int32_t actual_len = (int32_t) strlen (op->name) ; + int32_t name_len = op->name_len ; + char *op_name = (actual_len > 0) ? op->name : "f" ; if (opcode == GB_USER_binop_code) { // user-defined binary operator - GBPR0 ("(user-defined): z=%s(x,y)\n", op->name) ; + GBPR0 ("(user-defined): z=%s(x,y)\n", op_name) ; } else if (opcode == GB_FIRST_binop_code && 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): z=%s(x,y)\n", op_name) ; } else if (op_is_positional) { // built-in positional binary operator - GBPR0 ("(built-in positional): z=%s(x,y,i,k,j)\n", op->name) ; + GBPR0 ("(built-in positional): z=%s(x,y,i,k,j)\n", op_name) ; } else { // built-in - GBPR0 ("(built-in): z=%s(x,y)\n", op->name) ; + GBPR0 ("(built-in): z=%s(x,y)\n", op_name) ; } if (!(op_is_positional || op_is_first || op_is_second) @@ -89,8 +92,6 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator return (GrB_INVALID_OBJECT) ; } - int32_t name_len = op->name_len ; - int32_t actual_len = (int32_t) strlen (op->name) ; if (opcode == GB_USER_binop_code && name_len != actual_len) { GBPR0 (" BinaryOp has an invalid name_len\n") ; diff --git a/GraphBLAS/Source/GB_Context.c b/GraphBLAS/Source/GB_Context.c index 61258a41d5..2a94fe7574 100644 --- a/GraphBLAS/Source/GB_Context.c +++ b/GraphBLAS/Source/GB_Context.c @@ -43,7 +43,7 @@ #elif defined ( HAVE_KEYWORD__THREAD_LOCAL ) - // ANSI C11 threads + // C11 threads #include _Thread_local GxB_Context GB_CONTEXT_THREAD = NULL ; diff --git a/GraphBLAS/Source/GB_Global.c b/GraphBLAS/Source/GB_Global.c index c6a34e47ce..1eb2750a78 100644 --- a/GraphBLAS/Source/GB_Global.c +++ b/GraphBLAS/Source/GB_Global.c @@ -38,6 +38,7 @@ typedef struct float bitmap_switch [GxB_NBITMAP_SWITCH] ; // default bitmap_switch float hyper_switch ; // default hyper_switch for new matrices bool is_csc ; // default CSR/CSC format for new matrices + int64_t hyper_hash ; // controls when A->Y hyper_hash is created //-------------------------------------------------------------------------- // abort function: only used for debugging @@ -50,7 +51,7 @@ typedef struct //-------------------------------------------------------------------------- // All threads must use the same malloc/realloc/free functions. - // They default to the ANSI C11 functions, but can be defined by GxB_init. + // They default to the C11 functions, but can be defined by GxB_init. void * (* malloc_function ) (size_t) ; // required void * (* calloc_function ) (size_t, size_t) ; // may be NULL @@ -175,10 +176,12 @@ static GB_Global_struct GB_Global = .is_csc = false, // default is GxB_BY_ROW + .hyper_hash = GB_HYPER_HASH_DEFAULT, + // abort function for debugging only .abort_function = abort, - // malloc/realloc/free functions: default to ANSI C11 functions + // malloc/realloc/free functions: default to C11 functions .malloc_function = malloc, .realloc_function = realloc, .free_function = free, @@ -342,6 +345,20 @@ float GB_Global_hyper_switch_get (void) return (GB_Global.hyper_switch) ; } +//------------------------------------------------------------------------------ +// hyper_hash +//------------------------------------------------------------------------------ + +void GB_Global_hyper_hash_set (int64_t hyper_hash) +{ + GB_Global.hyper_hash = hyper_hash ; +} + +int64_t GB_Global_hyper_hash_get (void) +{ + return (GB_Global.hyper_hash) ; +} + //------------------------------------------------------------------------------ // bitmap_switch //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/GB_Global.h b/GraphBLAS/Source/GB_Global.h index dc483cfc96..0f42b8767c 100644 --- a/GraphBLAS/Source/GB_Global.h +++ b/GraphBLAS/Source/GB_Global.h @@ -30,6 +30,9 @@ bool GB_Global_GrB_init_called_get (void) ; void GB_Global_hyper_switch_set (float hyper_switch) ; float GB_Global_hyper_switch_get (void) ; +void GB_Global_hyper_hash_set (int64_t hyper_hash) ; +int64_t GB_Global_hyper_hash_get (void) ; + void GB_Global_bitmap_switch_set (int k, float b) ; float GB_Global_bitmap_switch_get (int k) ; float GB_Global_bitmap_switch_matrix_get diff --git a/GraphBLAS/Source/GB_IndexUnaryOp_check.c b/GraphBLAS/Source/GB_IndexUnaryOp_check.c index cec6c13446..99a07b49dc 100644 --- a/GraphBLAS/Source/GB_IndexUnaryOp_check.c +++ b/GraphBLAS/Source/GB_IndexUnaryOp_check.c @@ -49,7 +49,11 @@ GrB_Info GB_IndexUnaryOp_check // check a GraphBLAS index_unary operator { GBPR0 ("(built-in): ") ; } - GBPR0 ("z=%s(x,i,j,y)\n", op->name) ; + + int32_t name_len = op->name_len ; + int32_t actual_len = (int32_t) strlen (op->name) ; + char *op_name = (actual_len > 0) ? op->name : "f" ; + GBPR0 ("z=%s(x,i,j,y)\n", op_name) ; if (op->idxunop_function == NULL) { @@ -57,8 +61,6 @@ GrB_Info GB_IndexUnaryOp_check // check a GraphBLAS index_unary operator return (GrB_INVALID_OBJECT) ; } - int32_t name_len = op->name_len ; - int32_t actual_len = (int32_t) strlen (op->name) ; if (opcode == GB_USER_idxunop_code && name_len != actual_len) { GBPR0 (" IndexUnaryOp has an invalid name_len\n") ; diff --git a/GraphBLAS/Source/GB_Matrix_free.c b/GraphBLAS/Source/GB_Matrix_free.c index 1f47b822df..c1ffd917cf 100644 --- a/GraphBLAS/Source/GB_Matrix_free.c +++ b/GraphBLAS/Source/GB_Matrix_free.c @@ -24,6 +24,7 @@ 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) ; size_t header_size = A->header_size ; GB_phybix_free (A) ; if (!(A->static_header)) diff --git a/GraphBLAS/Source/GB_Monoid_new.c b/GraphBLAS/Source/GB_Monoid_new.c index b33780f972..5aec6e0c91 100644 --- a/GraphBLAS/Source/GB_Monoid_new.c +++ b/GraphBLAS/Source/GB_Monoid_new.c @@ -100,6 +100,8 @@ GrB_Info GB_Monoid_new // create a monoid GrB_Monoid mon = *monoid ; mon->magic = GB_MAGIC ; mon->header_size = header_size ; + mon->user_name = NULL ; // user_name for GrB_get/GrB_set + mon->user_name_size = 0 ; mon->op = op ; size_t zsize = op->ztype->size ; mon->identity = NULL ; // defined below (if present) diff --git a/GraphBLAS/Source/GB_Op_free.c b/GraphBLAS/Source/GB_Op_free.c index 3733996400..ce62904639 100644 --- a/GraphBLAS/Source/GB_Op_free.c +++ b/GraphBLAS/Source/GB_Op_free.c @@ -21,14 +21,15 @@ 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) ; + size_t defn_size = op->defn_size ; + if (defn_size > 0) + { + GB_FREE (&(op->defn), defn_size) ; + } size_t header_size = op->header_size ; if (header_size > 0) { - size_t defn_size = op->defn_size ; - if (defn_size > 0) - { - GB_FREE (&(op->defn), defn_size) ; - } op->magic = GB_FREED ; // to help detect dangling pointers op->header_size = 0 ; GB_FREE (op_handle, header_size) ; diff --git a/GraphBLAS/Source/GB_Pending.h b/GraphBLAS/Source/GB_Pending.h index f2da17aac3..3a8f6b354e 100644 --- a/GraphBLAS/Source/GB_Pending.h +++ b/GraphBLAS/Source/GB_Pending.h @@ -11,6 +11,10 @@ #define GB_PENDING_H #include "GB.h" +// FUTURE: remove this once GxB_Matrix_pending is revised (see PR #172) +// true if a matrix is hypersparse and needs its hyper_hash built +#define GB_NEED_HYPER_HASH(A) GB_hyper_hash_need (A) + //------------------------------------------------------------------------------ // GB_Pending functions //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/GB_Scalar_wrap.c b/GraphBLAS/Source/GB_Scalar_wrap.c index cf44365d66..6da7e5e52b 100644 --- a/GraphBLAS/Source/GB_Scalar_wrap.c +++ b/GraphBLAS/Source/GB_Scalar_wrap.c @@ -36,6 +36,8 @@ GrB_Scalar GB_Scalar_wrap // create a new GrB_Scalar with one entry s->magic = GB_MAGIC ; s->header_size = 0 ; + s->user_name = NULL ; + s->user_name_size = 0 ; s->type = (type == NULL) ? GrB_BOOL : type ; s->logger = NULL ; s->logger_size = 0 ; diff --git a/GraphBLAS/Source/GB_Semiring_new.c b/GraphBLAS/Source/GB_Semiring_new.c index 71b440a9f5..62b17e637e 100644 --- a/GraphBLAS/Source/GB_Semiring_new.c +++ b/GraphBLAS/Source/GB_Semiring_new.c @@ -43,6 +43,8 @@ GrB_Info GB_Semiring_new // create a semiring // initialize the semiring semiring->magic = GB_MAGIC ; + semiring->user_name = NULL ; // user_name for GrB_get/GrB_set + semiring->user_name_size = 0 ; semiring->add = add ; semiring->multiply = multiply ; semiring->name = NULL ; diff --git a/GraphBLAS/Source/GB_UnaryOp_check.c b/GraphBLAS/Source/GB_UnaryOp_check.c index 7348d42bbb..f5e1daaa29 100644 --- a/GraphBLAS/Source/GB_UnaryOp_check.c +++ b/GraphBLAS/Source/GB_UnaryOp_check.c @@ -49,7 +49,10 @@ GrB_Info GB_UnaryOp_check // check a GraphBLAS unary operator { GBPR0 ("(built-in): ") ; } - GBPR0 ("z=%s(x)\n", op->name) ; + int32_t name_len = op->name_len ; + int32_t actual_len = (int32_t) strlen (op->name) ; + char *op_name = (actual_len > 0) ? op->name : "f" ; + GBPR0 ("z=%s(x)\n", op_name) ; bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; bool op_is_one = (opcode == GB_ONE_unop_code) ; @@ -61,8 +64,6 @@ GrB_Info GB_UnaryOp_check // check a GraphBLAS unary operator return (GrB_INVALID_OBJECT) ; } - int32_t name_len = op->name_len ; - int32_t actual_len = (int32_t) strlen (op->name) ; if (opcode == GB_USER_unop_code && name_len != actual_len) { GBPR0 (" UnaryOp has an invalid name_len\n") ; diff --git a/GraphBLAS/Source/GB_add_phase0.c b/GraphBLAS/Source/GB_add_phase0.c index ee5b654b3b..067eded6b7 100644 --- a/GraphBLAS/Source/GB_add_phase0.c +++ b/GraphBLAS/Source/GB_add_phase0.c @@ -278,15 +278,15 @@ GrB_Info GB_add_phase0 // find vectors in C for C=A+B or C=A+B GB_OK (GB_hyper_hash_build (A, Werk)) ; GB_OK (GB_hyper_hash_build (B, Werk)) ; - const int64_t *restrict A_Yp = (A_is_hyper) ? A->Y->p : NULL ; - const int64_t *restrict A_Yi = (A_is_hyper) ? A->Y->i : NULL ; - const int64_t *restrict A_Yx = (A_is_hyper) ? A->Y->x : NULL ; - const int64_t A_hash_bits = (A_is_hyper) ? (A->Y->vdim - 1) : 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 int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; - const int64_t *restrict B_Yp = (B_is_hyper) ? B->Y->p : NULL ; - const int64_t *restrict B_Yi = (B_is_hyper) ? B->Y->i : NULL ; - const int64_t *restrict B_Yx = (B_is_hyper) ? B->Y->x : NULL ; - const int64_t B_hash_bits = (B_is_hyper) ? (B->Y->vdim - 1) : 0 ; + 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 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) @@ -297,16 +297,16 @@ GrB_Info GB_add_phase0 // find vectors in C for C=A+B or C=A+B { // 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 (Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, j, &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) ; 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 (Bp, B_Yp, B_Yi, B_Yx, - B_hash_bits, j, &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) ; C_to_B [k] = (pB < pB_end) ? kB : -1 ; } } @@ -676,10 +676,10 @@ GrB_Info GB_add_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 M_Yp = M->Y->p ; - const int64_t *restrict M_Yi = M->Y->i ; - const int64_t *restrict M_Yx = M->Y->x ; - const int64_t M_hash_bits = M->Y->vdim - 1 ; + 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->p ; + const int64_t *restrict M_Yx = (M->Y == NULL) ? NULL : M->Y->p ; + 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) @@ -688,8 +688,8 @@ GrB_Info GB_add_phase0 // find vectors in C for C=A+B or C=A+B int64_t j = 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 (Mp, M_Yp, M_Yi, M_Yx, - M_hash_bits, j, &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) ; C_to_M [k] = (pM < pM_end) ? kM : -1 ; } } diff --git a/GraphBLAS/Source/GB_assign_zombie1.c b/GraphBLAS/Source/GB_assign_zombie1.c index 5f7ab6a056..095371b6a7 100644 --- a/GraphBLAS/Source/GB_assign_zombie1.c +++ b/GraphBLAS/Source/GB_assign_zombie1.c @@ -40,13 +40,19 @@ GrB_Info GB_assign_zombie1 //-------------------------------------------------------------------------- int64_t *restrict Ci = C->i ; + const int64_t *restrict Ch = C->h ; const int64_t *restrict Cp = C->p ; int64_t pC_start, pC_end ; + const int64_t cnvec = C->nvec ; - if (C->h != NULL) + if (Ch != NULL) { // C is hypersparse - GB_hyper_hash_lookup (Cp, C->Y->p, C->Y->i, C->Y->x, C->Y->vdim-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 ; + 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, j, &pC_start, &pC_end) ; } else diff --git a/GraphBLAS/Source/GB_assign_zombie3.c b/GraphBLAS/Source/GB_assign_zombie3.c index 7f46f0a9be..b6e792a48d 100644 --- a/GraphBLAS/Source/GB_assign_zombie3.c +++ b/GraphBLAS/Source/GB_assign_zombie3.c @@ -60,14 +60,20 @@ GrB_Info GB_assign_zombie3 // get C (:,j) //-------------------------------------------------------------------------- - const int64_t *restrict Cp = C->p ; int64_t *restrict Ci = C->i ; + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; int64_t pC_start, pC_end ; + const int64_t cnvec = C->nvec ; - if (C->h != NULL) + if (Ch != NULL) { // C is hypersparse - GB_hyper_hash_lookup (Cp, C->Y->p, C->Y->i, C->Y->x, C->Y->vdim-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 ; + 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, j, &pC_start, &pC_end) ; } else diff --git a/GraphBLAS/Source/GB_assign_zombie4.c b/GraphBLAS/Source/GB_assign_zombie4.c index 6c9c429a50..b0bd60341e 100644 --- a/GraphBLAS/Source/GB_assign_zombie4.c +++ b/GraphBLAS/Source/GB_assign_zombie4.c @@ -70,19 +70,19 @@ GrB_Info GB_assign_zombie4 //-------------------------------------------------------------------------- const int64_t *restrict Mp = M->p ; -// const int64_t *restrict Mh = M->h ; + const int64_t *restrict 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 ; + const int64_t Mnvec = M->nvec ; ASSERT (M->vlen == 1) ; 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_is_hyper) ? M->Y->p : NULL ; - const int64_t *restrict M_Yi = (M_is_hyper) ? M->Y->i : NULL ; - const int64_t *restrict M_Yx = (M_is_hyper) ? M->Y->x : NULL ; - const int64_t M_hash_bits = (M_is_hyper) ? (M->Y->vdim - 1) : 0 ; + 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 int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; //-------------------------------------------------------------------------- // determine the number of threads to use @@ -158,8 +158,8 @@ GrB_Info GB_assign_zombie4 if (M_is_hyper) { // M is hypersparse - GB_hyper_hash_lookup (Mp, M_Yp, M_Yi, M_Yx, - M_hash_bits, j, &pM, &pM_end) ; + GB_hyper_hash_lookup (Mh, Mnvec, Mp, M_Yp, M_Yi, + M_Yx, M_hash_bits, j, &pM, &pM_end) ; } else { diff --git a/GraphBLAS/Source/GB_assign_zombie5.c b/GraphBLAS/Source/GB_assign_zombie5.c index 69fe425a1f..9a55d50fd4 100644 --- a/GraphBLAS/Source/GB_assign_zombie5.c +++ b/GraphBLAS/Source/GB_assign_zombie5.c @@ -92,10 +92,10 @@ 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_is_hyper) ? M->Y->p : NULL ; - const int64_t *restrict M_Yi = (M_is_hyper) ? M->Y->i : NULL ; - const int64_t *restrict M_Yx = (M_is_hyper) ? M->Y->x : NULL ; - const int64_t M_hash_bits = (M_is_hyper) ? (M->Y->vdim - 1) : 0 ; + 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 int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; //-------------------------------------------------------------------------- // determine the number of threads to use @@ -157,8 +157,8 @@ GrB_Info GB_assign_zombie5 if (M_is_hyper) { // M is hypersparse - GB_hyper_hash_lookup (Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, - j, &pM_start, &pM_end) ; + GB_hyper_hash_lookup (Mh, Mnvec, Mp, M_Yp, M_Yi, M_Yx, + M_hash_bits, j, &pM_start, &pM_end) ; } else { diff --git a/GraphBLAS/Source/GB_binop_new.c b/GraphBLAS/Source/GB_binop_new.c index 4abcf4750e..3860ebb6b4 100644 --- a/GraphBLAS/Source/GB_binop_new.c +++ b/GraphBLAS/Source/GB_binop_new.c @@ -45,6 +45,8 @@ GrB_Info GB_binop_new //-------------------------------------------------------------------------- op->magic = GB_MAGIC ; + op->user_name = NULL ; + op->user_name_size = 0 ; op->ztype = ztype ; op->xtype = xtype ; op->ytype = ytype ; @@ -67,7 +69,6 @@ GrB_Info GB_binop_new // output: op->name, &(op->name_len), &(op->hash), &(op->defn), &(op->defn_size), // input: - binop_name, binop_defn, "GxB_binary_function", 19, - opcode == GB_USER_binop_code, jitable)) ; + binop_name, binop_defn, opcode == GB_USER_binop_code, jitable)) ; } diff --git a/GraphBLAS/Source/GB_bitwise.h b/GraphBLAS/Source/GB_bitwise.h index 859eeecde0..c404be0d98 100644 --- a/GraphBLAS/Source/GB_bitwise.h +++ b/GraphBLAS/Source/GB_bitwise.h @@ -364,7 +364,7 @@ inline uint8_t GB_bitshift_uint8 (uint8_t x, int8_t k) } else if (k >= 8 || k <= -8) { - // ANSI C11 states that the result of x << k is undefined if k is + // C11 states that the result of x << k is undefined if k is // negative or if k is greater than the # of bits in x. Here, the // result is defined to be zero (the same as if shifting left // or right by 8). @@ -372,13 +372,13 @@ inline uint8_t GB_bitshift_uint8 (uint8_t x, int8_t k) } else if (k > 0) { - // left shift x by k bits. z is defined by ANSI C11 as + // left shift x by k bits. z is defined by C11 as // (x * (2^k)) mod (uintmax + 1). return (x << k) ; } else { - // right shift x by k bits. z is defined by ANSI C11 as the + // right shift x by k bits. z is defined by C11 as the // integral part of the quotient of x / (2^k). return (x >> (-k)) ; } @@ -541,13 +541,13 @@ inline int8_t GB_bitshift_int8 (int8_t x, int8_t k) } else if (k >= 8) { - // ANSI C11 states that z = x << k is undefined if k is greater + // C11 states that z = x << k is undefined if k is greater // than the # of bits in x. Here, the result is defined to be zero. return (0) ; } else if (k <= -8) { - // ANSI C11 states that z = x >> (-k) is undefined if (-k) is + // C11 states that z = x >> (-k) is undefined if (-k) is // greater than the # of bits in x. Here, the result is defined to // be the sign of x (z = 0 if x >= 0 and z = -1 if x is negative). return ((x >= 0) ? 0 : -1) ; @@ -555,7 +555,7 @@ inline int8_t GB_bitshift_int8 (int8_t x, int8_t k) else if (k > 0) { // left shift x by k bits (where k is in range 1 to #bits - 1). - // ANSI C11 states that z is defined only if x is non-negative and + // C11 states that z is defined only if x is non-negative and // x * (2^k) is representable. This computation assumes x and z // are represented in 2's complement. The result depends on the // underlying machine architecture and the compiler. @@ -567,13 +567,13 @@ inline int8_t GB_bitshift_int8 (int8_t x, int8_t k) // right shift x by k bits (where k is in range 1 to 8) if (x >= 0) { - // ANSI C11 defines z as the integral part of the quotient + // C11 defines z as the integral part of the quotient // of x / (2^k). return (x >> k) ; } else { - // ANSI C11 states that the result is implementation-defined if + // C11 states that the result is implementation-defined if // x is negative. This computation assumes x and z are in 2's // complement, so 1-bits are shifted in on the left, and thus // the sign bit is always preserved. The result depends on the diff --git a/GraphBLAS/Source/GB_block.c b/GraphBLAS/Source/GB_block.c index 9a5577cff4..53e38c4cb3 100644 --- a/GraphBLAS/Source/GB_block.c +++ b/GraphBLAS/Source/GB_block.c @@ -29,7 +29,7 @@ GrB_Info GB_block // apply all pending computations if blocking mode enabled // wait if mode is blocking, or if too many pending tuples //-------------------------------------------------------------------------- - if (!(GB_ANY_PENDING_WORK (A) || GB_NEED_HYPER_HASH (A))) + if (!(GB_ANY_PENDING_WORK (A) || GB_hyper_hash_need (A))) { // no pending work, so no need to block return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/GB_boolean_rename.c b/GraphBLAS/Source/GB_boolean_rename.c index d91d853865..9d7548a886 100644 --- a/GraphBLAS/Source/GB_boolean_rename.c +++ b/GraphBLAS/Source/GB_boolean_rename.c @@ -23,7 +23,7 @@ // Those 6 names are in GraphBLAS but the pairs of names are equivalent. // GraphBLAS includes a built-in GrB_DIV_BOOL operator, so boolean division -// must be defined. ANSI C11 does not provide a definition either, and +// must be defined. C11 does not provide a definition either, and // dividing by zero (boolean false) will typically terminate an application. // In this GraphBLAS implementation, boolean division is treated as if it were // int1, where 1/1 = 1, 0/1 = 0, 0/0 = integer NaN = 0, 1/0 = +infinity = 1. diff --git a/GraphBLAS/Source/GB_code_name_get.c b/GraphBLAS/Source/GB_code_name_get.c new file mode 100644 index 0000000000..1d5c3af53c --- /dev/null +++ b/GraphBLAS/Source/GB_code_name_get.c @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// 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. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +const char *GB_code_name_get (GB_Type_code code, char *user_name) +{ + switch (code) + { + case GB_BOOL_code : return ("GrB_BOOL") ; + case GB_INT8_code : return ("GrB_INT8") ; + case GB_INT16_code : return ("GrB_INT16") ; + case GB_INT32_code : return ("GrB_INT32") ; + case GB_INT64_code : return ("GrB_INT64") ; + case GB_UINT8_code : return ("GrB_UINT8") ; + case GB_UINT16_code : return ("GrB_UINT16") ; + case GB_UINT32_code : return ("GrB_UINT32") ; + case GB_UINT64_code : return ("GrB_UINT64") ; + case GB_FP32_code : return ("GrB_FP32") ; + case GB_FP64_code : return ("GrB_FP64") ; + case GB_FC32_code : return ("GxB_FC32") ; + case GB_FC64_code : return ("GxB_FC64") ; + default: + case GB_UDT_code : return (user_name) ; + } +} + diff --git a/GraphBLAS/Source/GB_cuda_gateway.h b/GraphBLAS/Source/GB_cuda_gateway.h index 80ceaca4cf..cfb00a72ed 100644 --- a/GraphBLAS/Source/GB_cuda_gateway.h +++ b/GraphBLAS/Source/GB_cuda_gateway.h @@ -14,11 +14,11 @@ // #include'd in GraphBLAS/CUDA/GB_cuda.h, for use by the CUDA/GB_cuda_*.cu // gateway functions. -// If GRAPHBLAS_HAS_CUDA is defined in GraphBLAS/CMakeLists.txt, then GraphBLAS can call -// the C-callable gateway functions defined in GraphBLAS/CUDA/*.cu source -// files. If GRAPHBLAS_HAS_CUDA is not defined, then these functions are not called. The -// typedef always appears, since it is part of the GB_Global struct, whether -// or not CUDA is used. +// If GRAPHBLAS_HAS_CUDA is defined in GraphBLAS/CMakeLists.txt, then GraphBLAS +// can call the C-callable gateway functions defined in GraphBLAS/CUDA/*.cu +// source files. If GRAPHBLAS_HAS_CUDA is not defined, then these functions +// are not called. The typedef always appears, since it is part of the +// GB_Global struct, whether or not CUDA is used. #ifndef GB_CUDA_GATEWAY_H #define GB_CUDA_GATEWAY_H @@ -116,13 +116,13 @@ bool GB_cuda_get_device_properties GB_cuda_device *prop ) ; -bool GB_reduce_to_scalar_cuda_branch // return true to use the GPU +bool GB_cuda_reduce_to_scalar_branch // return true to use the GPU ( const GrB_Monoid monoid, // monoid to do the reduction const GrB_Matrix A // input matrix ) ; -GrB_Info GB_reduce_to_scalar_cuda +GrB_Info GB_cuda_reduce_to_scalar_jit ( // output: GB_void *s, // note: statically allocated on CPU stack; if @@ -139,7 +139,7 @@ bool GB_cuda_type_branch // return true if the type is OK on GPU const GrB_Type type // type to query ) ; -GrB_Info GB_AxB_dot3_cuda // C = A'*B using dot product method +GrB_Info GB_cuda_AxB_dot3_jit // C = A'*B using dot product method ( GrB_Matrix C, // output matrix, static header const GrB_Matrix M, // mask matrix @@ -150,7 +150,7 @@ GrB_Info GB_AxB_dot3_cuda // C = A'*B using dot product method const bool flipxy // if true, do z=fmult(b,a) vs fmult(a,b) ) ; -bool GB_AxB_dot3_cuda_branch +bool GB_cuda_AxB_dot3_branch ( const GrB_Matrix M, // mask matrix const bool Mask_struct, // if true, use the only structure of M diff --git a/GraphBLAS/Source/GB_deserialize.c b/GraphBLAS/Source/GB_deserialize.c index e6dcd15a50..48254488a9 100644 --- a/GraphBLAS/Source/GB_deserialize.c +++ b/GraphBLAS/Source/GB_deserialize.c @@ -10,6 +10,7 @@ // A parallel decompression of a serialized blob into a GrB_Matrix. #include "GB.h" +#include "GB_get_set.h" #include "GB_serialize.h" #define GB_FREE_ALL \ @@ -218,6 +219,41 @@ GrB_Info GB_deserialize // deserialize a matrix from a blob } C->magic = GB_MAGIC ; + //-------------------------------------------------------------------------- + // get the GrB_NAME and GrB_EL_TYPE_STRING + //-------------------------------------------------------------------------- + + // 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. + + if (version >= GxB_VERSION (8,1,0)) + { + + //---------------------------------------------------------------------- + // look for the two nul bytes in blob [s : blob_size-1] + //---------------------------------------------------------------------- + + int nfound = 0 ; + size_t ss [2] ; + for (size_t p = s ; p < blob_size && nfound < 2 ; p++) + { + if (blob [p] == 0) + { + ss [nfound++] = p ; + } + } + + if (nfound == 2) + { + // extract the GrB_NAME and GrB_EL_TYPE_STRING from the blob + char *user_name = (char *) (blob + s) ; +// char *eltype_string = (char *) (blob + ss [0] + 1) ; +// printf ("deserialize user_name [%s] eltype [%s]\n", user_name, +// eltype_string) ; + GB_OK (GB_matvec_name_set (C, user_name, GrB_NAME)) ; + } + } + //-------------------------------------------------------------------------- // return result //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/GB_dup_worker.c b/GraphBLAS/Source/GB_dup_worker.c index 63e97336a9..be0adf2c23 100644 --- a/GraphBLAS/Source/GB_dup_worker.c +++ b/GraphBLAS/Source/GB_dup_worker.c @@ -11,11 +11,13 @@ // if numeric is false, C->x is allocated but not initialized. -// If *Chandle is not NULL, the header is reused. It may be a static or -// dynamic header, depending on C->static_header. +// If *Chandle is not NULL on input, the header is reused. It may be a static +// or dynamic header, depending on C->static_header. #include "GB.h" -#define GB_FREE_ALL ; +#include "GB_get_set.h" +#define GB_FREE_ALL \ + GB_FREE (&C_user_name, C_user_name_size) ; GrB_Info GB_dup_worker // make an exact copy of a matrix ( @@ -64,6 +66,23 @@ GrB_Info GB_dup_worker // make an exact copy of a matrix int sparsity_control = A->sparsity_control ; GrB_Type atype = A->type ; + //-------------------------------------------------------------------------- + // copy the user_name of A, if present + //-------------------------------------------------------------------------- + + char *C_user_name = NULL ; + size_t C_user_name_size = 0 ; + if (A->user_name != NULL) + { + info = GB_user_name_set (&C_user_name, &C_user_name_size, + A->user_name, false) ; + if (info != GrB_SUCCESS) + { + // out of memory + return (info) ; + } + } + //-------------------------------------------------------------------------- // create C //-------------------------------------------------------------------------- @@ -115,14 +134,21 @@ GrB_Info GB_dup_worker // make an exact copy of a matrix } C->magic = GB_MAGIC ; // C->p and C->h are now initialized - #ifdef GB_DEBUG - if (numeric) ASSERT_MATRIX_OK (C, "C duplicate of A", GB0) ; - #endif + + //-------------------------------------------------------------------------- + // copy the user_name of A into C, if present + //-------------------------------------------------------------------------- + + C->user_name = C_user_name ; + C->user_name_size = C_user_name_size ; //-------------------------------------------------------------------------- // return the result //-------------------------------------------------------------------------- + #ifdef GB_DEBUG + if (numeric) ASSERT_MATRIX_OK (C, "C duplicate of A", GB0) ; + #endif return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/GB_emult_08_phase0.c b/GraphBLAS/Source/GB_emult_08_phase0.c index 13e54c0267..8ab085d4a1 100644 --- a/GraphBLAS/Source/GB_emult_08_phase0.c +++ b/GraphBLAS/Source/GB_emult_08_phase0.c @@ -426,10 +426,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B GB_OK (GB_hyper_hash_build (M, Werk)) ; const int64_t *restrict Mp = M->p ; - const int64_t *restrict M_Yp = M->Y->p ; - const int64_t *restrict M_Yi = M->Y->i ; - const int64_t *restrict M_Yx = M->Y->x ; - const int64_t M_hash_bits = M->Y->vdim - 1 ; + 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 int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; // compute C_to_M int64_t k ; @@ -438,7 +438,7 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B { int64_t pM, pM_end ; int64_t j = Ch [k] ; - int64_t kM = GB_hyper_hash_lookup (Mp, M_Yp, M_Yi, M_Yx, + int64_t kM = GB_hyper_hash_lookup (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 ; } @@ -464,10 +464,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B GB_OK (GB_hyper_hash_build (A, Werk)) ; const int64_t *restrict Ap = A->p ; - const int64_t *restrict A_Yp = A->Y->p ; - const int64_t *restrict A_Yi = A->Y->i ; - const int64_t *restrict A_Yx = A->Y->x ; - const int64_t A_hash_bits = A->Y->vdim - 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 ; + const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; // compute C_to_A int64_t k ; @@ -476,7 +476,7 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B { int64_t pA, pA_end ; int64_t j = Ch [k] ; - int64_t kA = GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, + int64_t kA = GB_hyper_hash_lookup (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 ; } @@ -502,10 +502,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B GB_OK (GB_hyper_hash_build (B, Werk)) ; const int64_t *restrict Bp = B->p ; - const int64_t *restrict B_Yp = B->Y->p ; - const int64_t *restrict B_Yi = B->Y->i ; - const int64_t *restrict B_Yx = B->Y->x ; - const int64_t B_hash_bits = B->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 int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; // compute C_to_B int64_t k ; @@ -514,7 +514,7 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B { int64_t pB, pB_end ; int64_t j = Ch [k] ; - int64_t kB = GB_hyper_hash_lookup (Bp, B_Yp, B_Yi, B_Yx, + int64_t kB = GB_hyper_hash_lookup (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 ; } diff --git a/GraphBLAS/Source/GB_get_set.h b/GraphBLAS/Source/GB_get_set.h new file mode 100644 index 0000000000..8e91c6dcc8 --- /dev/null +++ b/GraphBLAS/Source/GB_get_set.h @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------ +// GB_get_set.h: definitions for GrB_get/set methods +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_GET_SET_H +#define GB_GET_SET_H +#include "GB.h" + +struct GB_Global_opaque +{ + int64_t magic ; + size_t header_size ; +} ; + +GrB_Type_Code GB_type_code_get // return the GrB_Type_Code for the code +( + const GB_Type_code code // type code to convert +) ; + +const char *GB_type_name_get (GrB_Type type) ; +const char *GB_code_name_get (GB_Type_code code, char *user_name) ; + +GrB_Info GB_matvec_name_size_get (GrB_Matrix A, size_t *value, int field) ; +GrB_Info GB_matvec_name_get (GrB_Matrix A, char *name, int field) ; +GrB_Info GB_matvec_enum_get (GrB_Matrix A, int32_t *value, int field) ; +GrB_Info GB_matvec_name_set (GrB_Matrix A, char *value, int field) ; + +GrB_Info GB_matvec_set +( + GrB_Matrix A, + bool is_vector, // true if A is a GrB_Vector + int32_t ivalue, + double dvalue, + int field, + 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, + 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) ; + +const char *GB_op_name_get (GB_Operator op) ; +GrB_Info GB_op_string_set (GB_Operator op, char * value, GrB_Field field) ; + +const char *GB_monoid_name_get (GrB_Monoid monoid) ; +const char *GB_semiring_name_get (GrB_Semiring semiring) ; + +GrB_Info GB_op_or_type_string_set +( + // input: + bool user_defined, + bool jitable, + char *value, + int field, + // output: + char **user_name, + size_t *user_name_size, + char *name, + int32_t *name_len, + char **defn, + size_t *defn_size, + uint64_t *hash +) ; + +GrB_Info GB_monoid_get +( + GrB_Monoid monoid, + GrB_Scalar value, + GrB_Field field, + GB_Werk Werk +) ; + +GrB_Info GB_user_name_set +( + // input/output + char **object_user_name, // user_name of the object + size_t *object_user_name_size, // user_name_size of the object + // input + const char *new_name, // new name for the object + const bool only_once // if true, the name of the object can + // only be set once +) ; + + +#endif + diff --git a/GraphBLAS/Source/GB_hyper.h b/GraphBLAS/Source/GB_hyper.h index 116575f15b..884c33e09b 100644 --- a/GraphBLAS/Source/GB_hyper.h +++ b/GraphBLAS/Source/GB_hyper.h @@ -54,10 +54,17 @@ GrB_Info GB_hyper_hash_build // construct A->Y if not already constructed GB_Werk Werk ) ; +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. @@ -68,8 +75,7 @@ GrB_Info GB_hyper_hash_build // construct A->Y if not already constructed // 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 when the -// hyper_hash is too costly to build. +// With the introduction of the hyper_hash, this is used only for debugging. static inline bool GB_lookup // find j = Ah [k] ( @@ -95,14 +101,14 @@ static inline bool GB_lookup // find j = Ah [k] 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 ; @@ -119,6 +125,6 @@ static inline bool GB_lookup // find j = Ah [k] return (true) ; } } - +#endif #endif diff --git a/GraphBLAS/Source/GB_hyper_hash_build.c b/GraphBLAS/Source/GB_hyper_hash_build.c index 374d3a210c..78e9946ccc 100644 --- a/GraphBLAS/Source/GB_hyper_hash_build.c +++ b/GraphBLAS/Source/GB_hyper_hash_build.c @@ -35,9 +35,11 @@ GrB_Info GB_hyper_hash_build // construct A->Y if not already constructed // check inputs //-------------------------------------------------------------------------- - if (A == NULL || !GB_NEED_HYPER_HASH (A)) + if (!GB_hyper_hash_need (A)) { - // quick return: A is NULL, not hypersparse, or A->Y already computed + // quick return: A is NULL, not hypersparse, A->Y already computed, + // or A does not have enough non-empty vectors to warrant the creation + // of the A->Y hyper_hash return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/GB_hyper_hash_need.c b/GraphBLAS/Source/GB_hyper_hash_need.c new file mode 100644 index 0000000000..aefdcd33e8 --- /dev/null +++ b/GraphBLAS/Source/GB_hyper_hash_need.c @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// GB_hyper_hash_need: determine if a matrix needs its hyper_hash built +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// A hypersparse matrix A can use a hyper_hash matrix A->Y to speed up access +// to its hyper list, A->h. For extremely sparse matrices, building the +// hyper_hash can be costly, however. + +// If A has pending work, this test is not useful, since the format of A can +// change, and A->nvec could change if zombies are removed and pending tuples +// assembled. This test should only be used if a matrix has no other pending +// work. + +#include "GB.h" + +bool GB_hyper_hash_need +( + GrB_Matrix A +) +{ + + if (A == NULL || !GB_IS_HYPERSPARSE (A)) + { + // only hypersparse matrices require a hyper_hash + return (false) ; + } + + if (A->Y != NULL) + { + // A already has a hyper_hash + return (false) ; + } + + // 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/GB_hyper_shallow.c b/GraphBLAS/Source/GB_hyper_shallow.c index d3eb2e1fe1..f12a51736f 100644 --- a/GraphBLAS/Source/GB_hyper_shallow.c +++ b/GraphBLAS/Source/GB_hyper_shallow.c @@ -45,6 +45,10 @@ GrB_Matrix GB_hyper_shallow // return C C->static_header = C_static_header ; C->header_size = C_header_size ; + // remove the user_name + C->user_name = NULL ; + C->user_name_size = 0 ; + // remove the hyperlist and the hyper_hash C->h = NULL ; C->h_shallow = false ; diff --git a/GraphBLAS/Source/GB_init.c b/GraphBLAS/Source/GB_init.c index 275a7be1a0..7b55498369 100644 --- a/GraphBLAS/Source/GB_init.c +++ b/GraphBLAS/Source/GB_init.c @@ -97,7 +97,7 @@ GrB_Info GB_init // start up GraphBLAS GB_Global_GrB_init_called_set (true) ; - // GrB_init passes in the ANSI C11 malloc/calloc/realloc/free. + // GrB_init passes in the C11 malloc/calloc/realloc/free. GB_Global_malloc_function_set (malloc_function ) ; // cannot be NULL GB_Global_calloc_function_set (calloc_function ) ; // ok if NULL diff --git a/GraphBLAS/Source/GB_jitifyer.c b/GraphBLAS/Source/GB_jitifyer.c index e2364a1a28..7e96b03f04 100644 --- a/GraphBLAS/Source/GB_jitifyer.c +++ b/GraphBLAS/Source/GB_jitifyer.c @@ -548,6 +548,8 @@ GrB_Info GB_jitifyer_establish_paths (GrB_Info error_condition) // construct the c, lib, and lock paths and their 256 subfolders ok = ok && GB_jitifyer_path_256 ("c") ; + ok = ok && GB_jitifyer_path_256 ("cu") ; + ok = ok && GB_jitifyer_path_256 ("libcu") ; ok = ok && GB_jitifyer_path_256 ("lib") ; ok = ok && GB_jitifyer_path_256 ("lock") ; diff --git a/GraphBLAS/Source/GB_macrofy_cast_expression.c b/GraphBLAS/Source/GB_macrofy_cast_expression.c index 4cf5ffb64f..566ec1b071 100644 --- a/GraphBLAS/Source/GB_macrofy_cast_expression.c +++ b/GraphBLAS/Source/GB_macrofy_cast_expression.c @@ -268,7 +268,7 @@ const char *GB_macrofy_cast_expression // return cast expression { //---------------------------------------------------------------------- - // all other cases: use ANSI C11 typecasting rules + // all other cases: use C11 typecasting rules //---------------------------------------------------------------------- f = NULL ; diff --git a/GraphBLAS/Source/GB_macrofy_cast_input.c b/GraphBLAS/Source/GB_macrofy_cast_input.c index 21d105be8f..a7c8f9981d 100644 --- a/GraphBLAS/Source/GB_macrofy_cast_input.c +++ b/GraphBLAS/Source/GB_macrofy_cast_input.c @@ -66,7 +66,7 @@ void GB_macrofy_cast_input if (f == NULL) { - // ANSI C11 typecasting + // C11 typecasting ASSERT (ztype != xtype) ; fprintf (fp, "#define %s(%s,%s) %s = (%s) (%s)\n", macro_name, zarg, xargs, zarg, ztype->name, xexpr) ; diff --git a/GraphBLAS/Source/GB_macrofy_cast_output.c b/GraphBLAS/Source/GB_macrofy_cast_output.c index 31f1e55763..68990080c7 100644 --- a/GraphBLAS/Source/GB_macrofy_cast_output.c +++ b/GraphBLAS/Source/GB_macrofy_cast_output.c @@ -47,7 +47,7 @@ void GB_macrofy_cast_output if (f == NULL) { - // ANSI C11 typecasting + // C11 typecasting ASSERT (ztype != xtype) ; fprintf (fp, "#define %s(%s,%s) %s = (%s) (%s)\n", macro_name, zarg, xargs, xexpr, xtype->name, zarg) ; diff --git a/GraphBLAS/Source/GB_math.h b/GraphBLAS/Source/GB_math.h index 8bcf24b6b5..559cdf16e2 100644 --- a/GraphBLAS/Source/GB_math.h +++ b/GraphBLAS/Source/GB_math.h @@ -296,6 +296,9 @@ inline uint64_t GB_idiv_uint64 (uint64_t x, uint64_t y) // Three cases below are from ACM Algo 116, R. L. Smith, 1962. +#if !defined ( GBCUDA_CPLUSPLUS ) +// TODO: does not yet work in CUDA + inline GxB_FC64_t GB_FC64_div (GxB_FC64_t x, GxB_FC64_t y) { double xr = GB_creal (x) ; @@ -398,6 +401,8 @@ inline GxB_FC32_t GB_FC32_div (GxB_FC32_t x, GxB_FC32_t y) " return (GJ_CMPLX32 ((float) GB_creal(zz), (float) GB_cimag(zz))) ; \n" \ "}" +#endif + //------------------------------------------------------------------------------ // z = x^y: wrappers for pow, powf, cpow, and cpowf //------------------------------------------------------------------------------ @@ -479,6 +484,9 @@ inline double GB_pow (double x, double y) " return (pow (x, y)) ; \n" \ "}" +#if !defined ( GBCUDA_CPLUSPLUS ) +// TODO: does not yet work in CUDA + inline GxB_FC32_t GB_FC32_pow (GxB_FC32_t x, GxB_FC32_t y) { float xr = GB_crealf (x) ; @@ -600,6 +608,7 @@ inline GxB_FC64_t GB_FC64_pow (GxB_FC64_t x, GxB_FC64_t y) " } \n" \ " return (GB_cpow (x, y)) ; \n" \ "}" +#endif inline int8_t GB_pow_int8 (int8_t x, int8_t y) { @@ -783,6 +792,9 @@ inline double GB_signum (double x) " return ((double) ((x < 0) ? (-1) : ((x > 0) ? 1 : 0))) ; \n" \ "}" +#if !defined ( GBCUDA_CPLUSPLUS ) +// TODO: does not yet work in CUDA + inline GxB_FC32_t GB_csignumf (GxB_FC32_t x) { if (GB_crealf (x) == 0 && GB_cimagf (x) == 0) @@ -829,9 +841,9 @@ inline GxB_FC64_t GB_csignum (GxB_FC64_t x) // complex functions //------------------------------------------------------------------------------ -// The ANSI C11 math.h header defines the ceil, floor, round, trunc, +// The C11 math.h header defines the ceil, floor, round, trunc, // exp2, expm1, log10, log1pm, or log2 functions for float and double, -// but the corresponding functions do not appear in the ANSI C11 complex.h. +// but the corresponding functions do not appear in the C11 complex.h. // These functions are used instead, for float complex and double complex. //------------------------------------------------------------------------------ @@ -1246,3 +1258,5 @@ inline bool GB_cisfinite (GxB_FC64_t x) #endif +#endif + diff --git a/GraphBLAS/Source/GB_matvec_enum_get.c b/GraphBLAS/Source/GB_matvec_enum_get.c new file mode 100644 index 0000000000..69156f2ca3 --- /dev/null +++ b/GraphBLAS/Source/GB_matvec_enum_get.c @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// GB_matvec_enum_get: get an enum field from a matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_matvec_enum_get (GrB_Matrix A, int32_t *value, int field) +{ + switch (field) + { + case GrB_STORAGE_ORIENTATION_HINT : + + (*value) = (A->is_csc) ? GrB_COLMAJOR : GrB_ROWMAJOR ; + break ; + + case GrB_EL_TYPE_CODE : + + (*value) = GB_type_code_get (A->type->code) ; + break ; + + case GxB_SPARSITY_CONTROL : + + (*value) = A->sparsity_control ; + break ; + + case GxB_SPARSITY_STATUS : + + (*value) = GB_sparsity (A) ; + break ; + + case GxB_FORMAT : + + (*value) = (A->is_csc) ? GxB_BY_COL : GxB_BY_ROW ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GB_matvec_name_get.c b/GraphBLAS/Source/GB_matvec_name_get.c new file mode 100644 index 0000000000..43aaae300e --- /dev/null +++ b/GraphBLAS/Source/GB_matvec_name_get.c @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// GB_matvec_name_get: get a name of a matrix or its type +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_matvec_name_get (GrB_Matrix A, char *name, int field) +{ + const char *typename ; + (*name) = '\0' ; + + switch (field) + { + + case GrB_NAME : + if (A->user_name != NULL) + { + strcpy (name, A->user_name) ; + } + break ; + + case GxB_JIT_C_NAME : + strcpy (name, A->type->name) ; + break ; + + case GrB_EL_TYPE_STRING : + typename = GB_type_name_get (A->type) ; + if (typename != NULL) + { + strcpy (name, typename) ; + } + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GB_matvec_name_set.c b/GraphBLAS/Source/GB_matvec_name_set.c new file mode 100644 index 0000000000..f0747f4075 --- /dev/null +++ b/GraphBLAS/Source/GB_matvec_name_set.c @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// GB_matvec_name_set: set the user_name of a matrix/vector/scalar +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_matvec_name_set +( + GrB_Matrix A, + char *value, + int field +) +{ + + if (field != GrB_NAME) + { + return (GrB_INVALID_VALUE) ; + } + + return (GB_user_name_set (&(A->user_name), &(A->user_name_size), value, + false)) ; +} + diff --git a/GraphBLAS/Source/GB_matvec_name_size_get.c b/GraphBLAS/Source/GB_matvec_name_size_get.c new file mode 100644 index 0000000000..85fcd12ff7 --- /dev/null +++ b/GraphBLAS/Source/GB_matvec_name_size_get.c @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// 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. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_matvec_name_size_get (GrB_Matrix A, size_t *value, int field) +{ + const char *name = NULL ; + + switch (field) + { + + case GrB_NAME : + name = A->user_name ; + break ; + + case GxB_JIT_C_NAME : + name = A->type->name ; + break ; + + case GrB_EL_TYPE_STRING : + name = GB_type_name_get (A->type) ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + (*value) = (name == NULL) ? 1 : (strlen (name) + 1) ; + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GB_matvec_set.c b/GraphBLAS/Source/GB_matvec_set.c new file mode 100644 index 0000000000..2d6139d82b --- /dev/null +++ b/GraphBLAS/Source/GB_matvec_set.c @@ -0,0 +1,94 @@ +//------------------------------------------------------------------------------ +// GB_matvec_set: set a field in a matrix or vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" +#include "GB_transpose.h" +#define GB_FREE_ALL ; + +GrB_Info GB_matvec_set +( + GrB_Matrix A, + bool is_vector, // true if A is a GrB_Vector + int ivalue, + double dvalue, + int field, + GB_Werk Werk +) +{ + + GrB_Info info ; + GB_BURBLE_START ("GrB_set") ; + + int format = ivalue ; + + switch (field) + { + + case GxB_HYPER_SWITCH : + + if (is_vector) + { + return (GrB_INVALID_VALUE) ; + } + A->hyper_switch = (float) dvalue ; + break ; + + case GxB_BITMAP_SWITCH : + + A->bitmap_switch = (float) dvalue ; + break ; + + case GxB_SPARSITY_CONTROL : + + A->sparsity_control = GB_sparsity_control (ivalue, (int64_t) (-1)) ; + break ; + + case GrB_STORAGE_ORIENTATION_HINT : + + format = (ivalue == GrB_COLMAJOR) ? GxB_BY_COL : GxB_BY_ROW ; + // fall through to the GxB_FORMAT case + + 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)) ; + } + 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) ; +} + diff --git a/GraphBLAS/Source/GB_monoid_get.c b/GraphBLAS/Source/GB_monoid_get.c new file mode 100644 index 0000000000..00fbe8e15f --- /dev/null +++ b/GraphBLAS/Source/GB_monoid_get.c @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// GB_monoid_get: get a field in a monoid +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_monoid_get +( + GrB_Monoid monoid, + GrB_Scalar value, + GrB_Field field, + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + case GrB_INP0_TYPE_CODE : + case GrB_INP1_TYPE_CODE : + case GrB_OUTP_TYPE_CODE : + + return (GB_op_scalar_get ((GB_Operator) monoid->op, value, field, + Werk)) ; + + case GxB_MONOID_IDENTITY : + + if (value->type != monoid->op->ztype) + { + // scalar type must match the monoid type + return (GrB_DOMAIN_MISMATCH) ; + } + return (GB_setElement ((GrB_Matrix) value, NULL, + monoid->identity, 0, 0, monoid->op->ztype->code, Werk)) ; + + case GxB_MONOID_TERMINAL : + + if (value->type != monoid->op->ztype) + { + // scalar type must match the monoid type + return (GrB_DOMAIN_MISMATCH) ; + } + if (monoid->terminal == NULL) + { + // monoid is not terminal: clear the output scalar. + // This is not an error + return (GB_clear ((GrB_Matrix) value, Werk)) ; + } + else + { + // monoid is terminal: return the terminal value. + return (GB_setElement ((GrB_Matrix) value, NULL, + monoid->terminal, 0, 0, monoid->op->ztype->code, + Werk)) ; + } + + default : + return (GrB_INVALID_VALUE) ; + } +} + diff --git a/GraphBLAS/Source/GB_monoid_name_get.c b/GraphBLAS/Source/GB_monoid_name_get.c new file mode 100644 index 0000000000..222bab4c6c --- /dev/null +++ b/GraphBLAS/Source/GB_monoid_name_get.c @@ -0,0 +1,213 @@ +//------------------------------------------------------------------------------ +// GB_monoid_name_get: get the name of a built-in monoid +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +const char *GB_monoid_name_get (GrB_Monoid monoid) +{ + + if (monoid->user_name_size > 0) + { + // user-defined monoid, with name defined by GrB_set + return (monoid->user_name) ; + } + + GB_Opcode opcode = monoid->op->opcode ; + GB_Type_code zcode = monoid->op->ztype->code ; + + switch (opcode) + { + + case GB_ANY_binop_code : // z = x or y + + switch (zcode) + { + case GB_BOOL_code : return ("GxB_ANY_BOOL_MONOID" ) ; + case GB_INT8_code : return ("GxB_ANY_INT8_MONOID" ) ; + case GB_INT16_code : return ("GxB_ANY_INT16_MONOID" ) ; + case GB_INT32_code : return ("GxB_ANY_INT32_MONOID" ) ; + case GB_INT64_code : return ("GxB_ANY_INT64_MONOID" ) ; + case GB_UINT8_code : return ("GxB_ANY_UINT8_MONOID" ) ; + case GB_UINT16_code : return ("GxB_ANY_UINT16_MONOID") ; + case GB_UINT32_code : return ("GxB_ANY_UINT32_MONOID") ; + case GB_UINT64_code : return ("GxB_ANY_UINT64_MONOID") ; + case GB_FP32_code : return ("GxB_ANY_FP32_MONOID" ) ; + case GB_FP64_code : return ("GxB_ANY_FP64_MONOID" ) ; + case GB_FC32_code : return ("GxB_ANY_FC32_MONOID" ) ; + case GB_FC64_code : return ("GxB_ANY_FC64_MONOID" ) ; + default :; + } + break ; + + case GB_MIN_binop_code : // z = min(x,y) + + switch (zcode) + { + case GB_INT8_code : return ("GrB_MIN_MONOID_INT8" ) ; + case GB_INT16_code : return ("GrB_MIN_MONOID_INT16" ) ; + case GB_INT32_code : return ("GrB_MIN_MONOID_INT32" ) ; + case GB_INT64_code : return ("GrB_MIN_MONOID_INT64" ) ; + case GB_UINT8_code : return ("GrB_MIN_MONOID_UINT8" ) ; + case GB_UINT16_code : return ("GrB_MIN_MONOID_UINT16") ; + case GB_UINT32_code : return ("GrB_MIN_MONOID_UINT32") ; + case GB_UINT64_code : return ("GrB_MIN_MONOID_UINT64") ; + case GB_FP32_code : return ("GrB_MIN_MONOID_FP32" ) ; + case GB_FP64_code : return ("GrB_MIN_MONOID_FP64" ) ; + default :; + } + break ; + + case GB_MAX_binop_code : // z = max(x,y) + + switch (zcode) + { + case GB_INT8_code : return ("GrB_MAX_MONOID_INT8" ) ; + case GB_INT16_code : return ("GrB_MAX_MONOID_INT16" ) ; + case GB_INT32_code : return ("GrB_MAX_MONOID_INT32" ) ; + case GB_INT64_code : return ("GrB_MAX_MONOID_INT64" ) ; + case GB_UINT8_code : return ("GrB_MAX_MONOID_UINT8" ) ; + case GB_UINT16_code : return ("GrB_MAX_MONOID_UINT16") ; + case GB_UINT32_code : return ("GrB_MAX_MONOID_UINT32") ; + case GB_UINT64_code : return ("GrB_MAX_MONOID_UINT64") ; + case GB_FP32_code : return ("GrB_MAX_MONOID_FP32" ) ; + case GB_FP64_code : return ("GrB_MAX_MONOID_FP64" ) ; + default :; + } + break ; + + case GB_PLUS_binop_code : // z = x + y + + switch (zcode) + { + case GB_INT8_code : return ("GrB_PLUS_MONOID_INT8" ) ; + case GB_INT16_code : return ("GrB_PLUS_MONOID_INT16" ) ; + case GB_INT32_code : return ("GrB_PLUS_MONOID_INT32" ) ; + case GB_INT64_code : return ("GrB_PLUS_MONOID_INT64" ) ; + case GB_UINT8_code : return ("GrB_PLUS_MONOID_UINT8" ) ; + case GB_UINT16_code : return ("GrB_PLUS_MONOID_UINT16") ; + case GB_UINT32_code : return ("GrB_PLUS_MONOID_UINT32") ; + case GB_UINT64_code : return ("GrB_PLUS_MONOID_UINT64") ; + case GB_FP32_code : return ("GrB_PLUS_MONOID_FP32" ) ; + case GB_FP64_code : return ("GrB_PLUS_MONOID_FP64" ) ; + case GB_FC32_code : return ("GxB_PLUS_FC32_MONOID" ) ; + case GB_FC64_code : return ("GxB_PLUS_FC64_MONOID" ) ; + default :; + } + break ; + + case GB_TIMES_binop_code : // z = x * y + + switch (zcode) + { + case GB_INT8_code : return ("GrB_TIMES_MONOID_INT8" ) ; + case GB_INT16_code : return ("GrB_TIMES_MONOID_INT16" ) ; + case GB_INT32_code : return ("GrB_TIMES_MONOID_INT32" ) ; + case GB_INT64_code : return ("GrB_TIMES_MONOID_INT64" ) ; + case GB_UINT8_code : return ("GrB_TIMES_MONOID_UINT8" ) ; + case GB_UINT16_code : return ("GrB_TIMES_MONOID_UINT16") ; + case GB_UINT32_code : return ("GrB_TIMES_MONOID_UINT32") ; + case GB_UINT64_code : return ("GrB_TIMES_MONOID_UINT64") ; + case GB_FP32_code : return ("GrB_TIMES_MONOID_FP32" ) ; + case GB_FP64_code : return ("GrB_TIMES_MONOID_FP64" ) ; + case GB_FC32_code : return ("GxB_TIMES_FC32_MONOID" ) ; + case GB_FC64_code : return ("GxB_TIMES_FC64_MONOID" ) ; + default :; + } + break ; + + case GB_LOR_binop_code : // z = (x != 0) || (y != 0) + + switch (zcode) + { + case GB_BOOL_code : return ("GrB_LOR_MONOID_BOOL") ; + default :; + } + break ; + + case GB_LAND_binop_code : // z = (x != 0) && (y != 0) + + switch (zcode) + { + case GB_BOOL_code : return ("GrB_LAND_MONOID_BOOL") ; + default :; + } + break ; + + case GB_LXOR_binop_code : // z = (x != 0) != (y != 0) + + switch (zcode) + { + case GB_BOOL_code : return ("GrB_LXOR_MONOID_BOOL") ; + default :; + } + break ; + + case GB_EQ_binop_code : // z = (x == y), is LXNOR for bool + + switch (zcode) + { + case GB_BOOL_code : return ("GrB_LXNOR_MONOID_BOOL") ; + default :; + } + break ; + + case GB_BOR_binop_code : // z = (x | y), bitwise or + + switch (zcode) + { + case GB_UINT8_code : return ("GxB_BOR_UINT8_MONOID" ) ; + case GB_UINT16_code : return ("GxB_BOR_UINT16_MONOID") ; + case GB_UINT32_code : return ("GxB_BOR_UINT32_MONOID") ; + case GB_UINT64_code : return ("GxB_BOR_UINT64_MONOID") ; + default :; + } + break ; + + case GB_BAND_binop_code : // z = (x & y), bitwise and + + switch (zcode) + { + case GB_UINT8_code : return ("GxB_BAND_UINT8_MONOID" ) ; + case GB_UINT16_code : return ("GxB_BAND_UINT16_MONOID") ; + case GB_UINT32_code : return ("GxB_BAND_UINT32_MONOID") ; + case GB_UINT64_code : return ("GxB_BAND_UINT64_MONOID") ; + default :; + } + break ; + + case GB_BXOR_binop_code : // z = (x ^ y), bitwise xor + + switch (zcode) + { + case GB_UINT8_code : return ("GxB_BXOR_UINT8_MONOID" ) ; + case GB_UINT16_code : return ("GxB_BXOR_UINT16_MONOID") ; + case GB_UINT32_code : return ("GxB_BXOR_UINT32_MONOID") ; + case GB_UINT64_code : return ("GxB_BXOR_UINT64_MONOID") ; + default :; + } + break ; + + case GB_BXNOR_binop_code : // z = ~(x ^ y), bitwise xnor + + switch (zcode) + { + case GB_UINT8_code : return ("GxB_BXNOR_UINT8_MONOID" ) ; + case GB_UINT16_code : return ("GxB_BXNOR_UINT16_MONOID") ; + case GB_UINT32_code : return ("GxB_BXNOR_UINT32_MONOID") ; + case GB_UINT64_code : return ("GxB_BXNOR_UINT64_MONOID") ; + default :; + } + break ; + + default: ; + } + + return (NULL) ; +} + diff --git a/GraphBLAS/Source/GB_new.c b/GraphBLAS/Source/GB_new.c index b92a4a20ac..7731d4b053 100644 --- a/GraphBLAS/Source/GB_new.c +++ b/GraphBLAS/Source/GB_new.c @@ -91,6 +91,8 @@ GrB_Info GB_new // create matrix, except for indices & values // basic information A->magic = GB_MAGIC2 ; // object is not yet valid A->type = type ; + A->user_name = NULL ; + A->user_name_size = 0 ; // no user_name yet A->logger = NULL ; // no error logged yet A->logger_size = 0 ; diff --git a/GraphBLAS/Source/GB_op.h b/GraphBLAS/Source/GB_op.h index 1cc2e0e1e0..6b41cc4250 100644 --- a/GraphBLAS/Source/GB_op.h +++ b/GraphBLAS/Source/GB_op.h @@ -32,8 +32,6 @@ GrB_Info GB_op_name_and_defn // input const char *input_name, // user-provided name, may be NULL const char *input_defn, // user-provided name, may be NULL - const char *typecast_name, // typecast name for function pointer - size_t typecast_len, // length of typecast_name bool user_op, // if true, a user-defined op bool jitable // if true, the op can be JIT'd ) ; diff --git a/GraphBLAS/Source/GB_op_enum_get.c b/GraphBLAS/Source/GB_op_enum_get.c new file mode 100644 index 0000000000..f2557fec26 --- /dev/null +++ b/GraphBLAS/Source/GB_op_enum_get.c @@ -0,0 +1,46 @@ +//------------------------------------------------------------------------------ +// GB_op_enum_get: get a field in an op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_op_enum_get +( + GB_Operator op, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + GrB_Type type = NULL ; + (*value) = -1 ; + + switch ((int) field) + { + case GrB_INP0_TYPE_CODE : type = op->xtype ; break ; + case GrB_INP1_TYPE_CODE : type = op->ytype ; break ; + case GrB_OUTP_TYPE_CODE : type = op->ztype ; break ; + default : ; + return (GrB_INVALID_VALUE) ; + } + + if (type == NULL) + { + // operator does not depend on this input + return (GrB_NO_VALUE) ; + } + + (*value) = (int32_t) GB_type_code_get (type->code) ; + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GB_op_name_and_defn.c b/GraphBLAS/Source/GB_op_name_and_defn.c index bf89b71ffd..f3b2bb73b7 100644 --- a/GraphBLAS/Source/GB_op_name_and_defn.c +++ b/GraphBLAS/Source/GB_op_name_and_defn.c @@ -26,10 +26,8 @@ GrB_Info GB_op_name_and_defn // input const char *input_name, // user-provided name, may be NULL const char *input_defn, // user-provided name, may be NULL - const char *typecast_name, // typecast name for function pointer - size_t typecast_len, // length of typecast_name bool user_op, // if true, a user-defined op - bool jitable // if false, the op cannot be JIT'd + bool jitable // if true, the op can be JIT'd ) { @@ -39,7 +37,6 @@ GrB_Info GB_op_name_and_defn ASSERT (op_name != NULL) ; ASSERT (op_defn != NULL) ; - ASSERT (typecast_name != NULL) ; ASSERT (op_defn_size != NULL) ; (*op_defn) = NULL ; (*op_defn_size) = 0 ; @@ -51,54 +48,22 @@ GrB_Info GB_op_name_and_defn // note: this can get a mangled name; see the BF methods in LAGraph memset (op_name, 0, GxB_MAX_NAME_LEN) ; - if (!user_op) - { - // FIRST_UDT operator created by GB_reduce_to_vector or - // SECOND_UDT operator created by GB_wait - ASSERT (input_name != NULL) ; - strncpy (op_name, input_name, GxB_MAX_NAME_LEN-1) ; - } - else if (input_name != NULL) + if (input_name != NULL) { - // copy the input_name into the working name - char working [GxB_MAX_NAME_LEN] ; - memset (working, 0, GxB_MAX_NAME_LEN) ; - strncpy (working, input_name, GxB_MAX_NAME_LEN-1) ; - // see if the typecast appears in the input_name - char *p = NULL ; - p = strstr (working, typecast_name) ; - if (p != NULL) - { - // skip past the typecast, the left parenthesis, and any whitespace - p += typecast_len ; - while (isspace (*p)) p++ ; - if (*p == ')') p++ ; - while (isspace (*p)) p++ ; - // p now contains the final name, copy it to the output name - strncpy (op_name, p, GxB_MAX_NAME_LEN-1) ; - } - else - { - // no typcast appears; copy the entire op_name as-is - memcpy (op_name, working, GxB_MAX_NAME_LEN) ; - } - } - else - { - // the user-defined op has no name, so give it a generic name - strncpy (op_name, "user_op", GxB_MAX_NAME_LEN-1) ; + // copy the input_name + strncpy (op_name, input_name, GxB_MAX_NAME_LEN-1) ; } // ensure op_name is null-terminated op_name [GxB_MAX_NAME_LEN-1] = '\0' ; - // get the operator name length and hash the name + // get the operator name length (zero if no name given) (*op_name_len) = (int32_t) strlen (op_name) ; // a user-defined op can only be JIT'd if it has a name and defn. // a new builtin op (created by GB_reduce_to_vector) can always be JIT'd. (*op_hash) = GB_jitifyer_hash (op_name, (*op_name_len), - jitable && (!user_op || (input_name != NULL && input_defn != NULL))) ; + jitable && (!user_op || (*op_name_len) > 0)) ; //-------------------------------------------------------------------------- // get the definition of the operator, if present diff --git a/GraphBLAS/Source/GB_op_name_get.c b/GraphBLAS/Source/GB_op_name_get.c new file mode 100644 index 0000000000..e7a5af1132 --- /dev/null +++ b/GraphBLAS/Source/GB_op_name_get.c @@ -0,0 +1,1702 @@ +//------------------------------------------------------------------------------ +// GB_op_name_get: get the user_name of any operator +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Three operators are left unnamed: identity_udt, 1st_udt, and 2nd_udt. +// These are created by GB_unop_identity, GB_reduce_to_vector, and +// GB_binop_second, and do not exist outside GraphBLAS. The user application +// cannot pass them to GrB_get. + +#include "GB_get_set.h" + +const char *GB_op_name_get (GB_Operator op) +{ + + GB_Opcode opcode = op->opcode ; + GB_Type_code xcode = (op->xtype == NULL) ? 0 : op->xtype->code ; + GB_Type_code zcode = (op->ztype == NULL) ? 0 : op->ztype->code ; + + switch (opcode) + { + + case GB_NOP_code : return ("GxB_IGNORE_DUP") ; + + //---------------------------------------------------------------------- + // unary operators + //---------------------------------------------------------------------- + + case GB_ONE_unop_code : // z = 1 + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_ONE_BOOL" ) ; + case GB_INT8_code : return ("GxB_ONE_INT8" ) ; + case GB_INT16_code : return ("GxB_ONE_INT16" ) ; + case GB_INT32_code : return ("GxB_ONE_INT32" ) ; + case GB_INT64_code : return ("GxB_ONE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ONE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ONE_UINT16") ; + case GB_UINT32_code : return ("GxB_ONE_UINT32") ; + case GB_UINT64_code : return ("GxB_ONE_UINT64") ; + case GB_FP32_code : return ("GxB_ONE_FP32" ) ; + case GB_FP64_code : return ("GxB_ONE_FP64" ) ; + case GB_FC32_code : return ("GxB_ONE_FC32" ) ; + case GB_FC64_code : return ("GxB_ONE_FC64" ) ; + default :; + } + break ; + + case GB_IDENTITY_unop_code : // z = x + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_IDENTITY_BOOL" ) ; + case GB_INT8_code : return ("GrB_IDENTITY_INT8" ) ; + case GB_INT16_code : return ("GrB_IDENTITY_INT16" ) ; + case GB_INT32_code : return ("GrB_IDENTITY_INT32" ) ; + case GB_INT64_code : return ("GrB_IDENTITY_INT64" ) ; + case GB_UINT8_code : return ("GrB_IDENTITY_UINT8" ) ; + case GB_UINT16_code : return ("GrB_IDENTITY_UINT16") ; + case GB_UINT32_code : return ("GrB_IDENTITY_UINT32") ; + case GB_UINT64_code : return ("GrB_IDENTITY_UINT64") ; + case GB_FP32_code : return ("GrB_IDENTITY_FP32" ) ; + case GB_FP64_code : return ("GrB_IDENTITY_FP64" ) ; + case GB_FC32_code : return ("GxB_IDENTITY_FC32" ) ; + case GB_FC64_code : return ("GxB_IDENTITY_FC64" ) ; + // see GB_unop_identity: +// case GB_UDT_code : +// return ("identity_udt") ; + default :; + } + break ; + + case GB_AINV_unop_code : // z = -x + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_AINV_BOOL" ) ; + case GB_INT8_code : return ("GrB_AINV_INT8" ) ; + case GB_INT16_code : return ("GrB_AINV_INT16" ) ; + case GB_INT32_code : return ("GrB_AINV_INT32" ) ; + case GB_INT64_code : return ("GrB_AINV_INT64" ) ; + case GB_UINT8_code : return ("GrB_AINV_UINT8" ) ; + case GB_UINT16_code : return ("GrB_AINV_UINT16") ; + case GB_UINT32_code : return ("GrB_AINV_UINT32") ; + case GB_UINT64_code : return ("GrB_AINV_UINT64") ; + case GB_FP32_code : return ("GrB_AINV_FP32" ) ; + case GB_FP64_code : return ("GrB_AINV_FP64" ) ; + case GB_FC32_code : return ("GxB_AINV_FC32" ) ; + case GB_FC64_code : return ("GxB_AINV_FC64" ) ; + default :; + } + break ; + + case GB_ABS_unop_code : // z = abs(x) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_ABS_BOOL" ) ; + case GB_INT8_code : return ("GrB_ABS_INT8" ) ; + case GB_INT16_code : return ("GrB_ABS_INT16" ) ; + case GB_INT32_code : return ("GrB_ABS_INT32" ) ; + case GB_INT64_code : return ("GrB_ABS_INT64" ) ; + case GB_UINT8_code : return ("GrB_ABS_UINT8" ) ; + case GB_UINT16_code : return ("GrB_ABS_UINT16") ; + case GB_UINT32_code : return ("GrB_ABS_UINT32") ; + case GB_UINT64_code : return ("GrB_ABS_UINT64") ; + case GB_FP32_code : return ("GrB_ABS_FP32" ) ; + case GB_FP64_code : return ("GrB_ABS_FP64" ) ; + case GB_FC32_code : return ("GxB_ABS_FC32" ) ; + case GB_FC64_code : return ("GxB_ABS_FC64" ) ; + default :; + } + break ; + + case GB_MINV_unop_code : // z = 1/x + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_MINV_BOOL" ) ; + case GB_INT8_code : return ("GrB_MINV_INT8" ) ; + case GB_INT16_code : return ("GrB_MINV_INT16" ) ; + case GB_INT32_code : return ("GrB_MINV_INT32" ) ; + case GB_INT64_code : return ("GrB_MINV_INT64" ) ; + case GB_UINT8_code : return ("GrB_MINV_UINT8" ) ; + case GB_UINT16_code : return ("GrB_MINV_UINT16") ; + case GB_UINT32_code : return ("GrB_MINV_UINT32") ; + case GB_UINT64_code : return ("GrB_MINV_UINT64") ; + case GB_FP32_code : return ("GrB_MINV_FP32" ) ; + case GB_FP64_code : return ("GrB_MINV_FP64" ) ; + case GB_FC32_code : return ("GxB_MINV_FC32" ) ; + case GB_FC64_code : return ("GxB_MINV_FC64" ) ; + default :; + } + break ; + + case GB_LNOT_unop_code : // z = !x + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_LNOT" ) ; + case GB_INT8_code : return ("GxB_LNOT_INT8" ) ; + case GB_INT16_code : return ("GxB_LNOT_INT16" ) ; + case GB_INT32_code : return ("GxB_LNOT_INT32" ) ; + case GB_INT64_code : return ("GxB_LNOT_INT64" ) ; + case GB_UINT8_code : return ("GxB_LNOT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LNOT_UINT16") ; + case GB_UINT32_code : return ("GxB_LNOT_UINT32") ; + case GB_UINT64_code : return ("GxB_LNOT_UINT64") ; + case GB_FP32_code : return ("GxB_LNOT_FP32" ) ; + case GB_FP64_code : return ("GxB_LNOT_FP64" ) ; + default :; + } + break ; + + case GB_BNOT_unop_code : // z = ~x + + switch (xcode) + { + case GB_INT8_code : return ("GrB_BNOT_INT8" ) ; + case GB_INT16_code : return ("GrB_BNOT_INT16" ) ; + case GB_INT32_code : return ("GrB_BNOT_INT32" ) ; + case GB_INT64_code : return ("GrB_BNOT_INT64" ) ; + case GB_UINT8_code : return ("GrB_BNOT_UINT8" ) ; + case GB_UINT16_code : return ("GrB_BNOT_UINT16") ; + case GB_UINT32_code : return ("GrB_BNOT_UINT32") ; + case GB_UINT64_code : return ("GrB_BNOT_UINT64") ; + default :; + } + break ; + + case GB_SQRT_unop_code : // z = sqrt (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_SQRT_FP32") ; + case GB_FP64_code : return ("GxB_SQRT_FP64") ; + case GB_FC32_code : return ("GxB_SQRT_FC32") ; + case GB_FC64_code : return ("GxB_SQRT_FC64") ; + default :; + } + break ; + + case GB_LOG_unop_code : // z = log (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_LOG_FP32") ; + case GB_FP64_code : return ("GxB_LOG_FP64") ; + case GB_FC32_code : return ("GxB_LOG_FC32") ; + case GB_FC64_code : return ("GxB_LOG_FC64") ; + default :; + } + break ; + + case GB_EXP_unop_code : // z = exp (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_EXP_FP32") ; + case GB_FP64_code : return ("GxB_EXP_FP64") ; + case GB_FC32_code : return ("GxB_EXP_FC32") ; + case GB_FC64_code : return ("GxB_EXP_FC64") ; + default :; + } + break ; + + case GB_SIN_unop_code : // z = sin (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_SIN_FP32") ; + case GB_FP64_code : return ("GxB_SIN_FP64") ; + case GB_FC32_code : return ("GxB_SIN_FC32") ; + case GB_FC64_code : return ("GxB_SIN_FC64") ; + default :; + } + break ; + + case GB_COS_unop_code : // z = cos (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_COS_FP32") ; + case GB_FP64_code : return ("GxB_COS_FP64") ; + case GB_FC32_code : return ("GxB_COS_FC32") ; + case GB_FC64_code : return ("GxB_COS_FC64") ; + default :; + } + break ; + + case GB_TAN_unop_code : // z = tan (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_TAN_FP32") ; + case GB_FP64_code : return ("GxB_TAN_FP64") ; + case GB_FC32_code : return ("GxB_TAN_FC32") ; + case GB_FC64_code : return ("GxB_TAN_FC64") ; + default :; + } + break ; + + case GB_ASIN_unop_code : // z = asin (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ASIN_FP32") ; + case GB_FP64_code : return ("GxB_ASIN_FP64") ; + case GB_FC32_code : return ("GxB_ASIN_FC32") ; + case GB_FC64_code : return ("GxB_ASIN_FC64") ; + default :; + } + break ; + + case GB_ACOS_unop_code : // z = acos (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ACOS_FP32") ; + case GB_FP64_code : return ("GxB_ACOS_FP64") ; + case GB_FC32_code : return ("GxB_ACOS_FC32") ; + case GB_FC64_code : return ("GxB_ACOS_FC64") ; + default :; + } + break ; + + case GB_ATAN_unop_code : // z = atan (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ATAN_FP32") ; + case GB_FP64_code : return ("GxB_ATAN_FP64") ; + case GB_FC32_code : return ("GxB_ATAN_FC32") ; + case GB_FC64_code : return ("GxB_ATAN_FC64") ; + default :; + } + break ; + + case GB_SINH_unop_code : // z = sinh (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_SINH_FP32") ; + case GB_FP64_code : return ("GxB_SINH_FP64") ; + case GB_FC32_code : return ("GxB_SINH_FC32") ; + case GB_FC64_code : return ("GxB_SINH_FC64") ; + default :; + } + break ; + + case GB_COSH_unop_code : // z = cosh (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_COSH_FP32") ; + case GB_FP64_code : return ("GxB_COSH_FP64") ; + case GB_FC32_code : return ("GxB_COSH_FC32") ; + case GB_FC64_code : return ("GxB_COSH_FC64") ; + default :; + } + break ; + + case GB_TANH_unop_code : // z = tanh (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_TANH_FP32") ; + case GB_FP64_code : return ("GxB_TANH_FP64") ; + case GB_FC32_code : return ("GxB_TANH_FC32") ; + case GB_FC64_code : return ("GxB_TANH_FC64") ; + default :; + } + break ; + + case GB_ASINH_unop_code : // z = asinh (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ASINH_FP32") ; + case GB_FP64_code : return ("GxB_ASINH_FP64") ; + case GB_FC32_code : return ("GxB_ASINH_FC32") ; + case GB_FC64_code : return ("GxB_ASINH_FC64") ; + default :; + } + break ; + + case GB_ACOSH_unop_code : // z = acosh (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ACOSH_FP32") ; + case GB_FP64_code : return ("GxB_ACOSH_FP64") ; + case GB_FC32_code : return ("GxB_ACOSH_FC32") ; + case GB_FC64_code : return ("GxB_ACOSH_FC64") ; + default :; + } + break ; + + case GB_ATANH_unop_code : // z = atanh (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ATANH_FP32") ; + case GB_FP64_code : return ("GxB_ATANH_FP64") ; + case GB_FC32_code : return ("GxB_ATANH_FC32") ; + case GB_FC64_code : return ("GxB_ATANH_FC64") ; + default :; + } + break ; + + case GB_SIGNUM_unop_code : // z = signum (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_SIGNUM_FP32") ; + case GB_FP64_code : return ("GxB_SIGNUM_FP64") ; + case GB_FC32_code : return ("GxB_SIGNUM_FC32") ; + case GB_FC64_code : return ("GxB_SIGNUM_FC64") ; + default :; + } + break ; + + case GB_CEIL_unop_code : // z = ceil (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_CEIL_FP32") ; + case GB_FP64_code : return ("GxB_CEIL_FP64") ; + case GB_FC32_code : return ("GxB_CEIL_FC32") ; + case GB_FC64_code : return ("GxB_CEIL_FC64") ; + default :; + } + break ; + + case GB_FLOOR_unop_code : // z = floor (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_FLOOR_FP32") ; + case GB_FP64_code : return ("GxB_FLOOR_FP64") ; + case GB_FC32_code : return ("GxB_FLOOR_FC32") ; + case GB_FC64_code : return ("GxB_FLOOR_FC64") ; + default :; + } + break ; + + case GB_ROUND_unop_code : // z = round (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ROUND_FP32") ; + case GB_FP64_code : return ("GxB_ROUND_FP64") ; + case GB_FC32_code : return ("GxB_ROUND_FC32") ; + case GB_FC64_code : return ("GxB_ROUND_FC64") ; + default :; + } + break ; + + case GB_TRUNC_unop_code : // z = trunc (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_TRUNC_FP32") ; + case GB_FP64_code : return ("GxB_TRUNC_FP64") ; + case GB_FC32_code : return ("GxB_TRUNC_FC32") ; + case GB_FC64_code : return ("GxB_TRUNC_FC64") ; + default :; + } + break ; + + case GB_EXP2_unop_code : // z = exp2 (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_EXP2_FP32") ; + case GB_FP64_code : return ("GxB_EXP2_FP64") ; + case GB_FC32_code : return ("GxB_EXP2_FC32") ; + case GB_FC64_code : return ("GxB_EXP2_FC64") ; + default :; + } + break ; + + case GB_EXPM1_unop_code : // z = expm1 (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_EXPM1_FP32") ; + case GB_FP64_code : return ("GxB_EXPM1_FP64") ; + case GB_FC32_code : return ("GxB_EXPM1_FC32") ; + case GB_FC64_code : return ("GxB_EXPM1_FC64") ; + default :; + } + break ; + + case GB_LOG10_unop_code : // z = log10 (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_LOG10_FP32") ; + case GB_FP64_code : return ("GxB_LOG10_FP64") ; + case GB_FC32_code : return ("GxB_LOG10_FC32") ; + case GB_FC64_code : return ("GxB_LOG10_FC64") ; + default :; + } + break ; + + case GB_LOG1P_unop_code : // z = log1P (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_LOG1P_FP32") ; + case GB_FP64_code : return ("GxB_LOG1P_FP64") ; + case GB_FC32_code : return ("GxB_LOG1P_FC32") ; + case GB_FC64_code : return ("GxB_LOG1P_FC64") ; + default :; + } + break ; + + case GB_LOG2_unop_code : // z = log2 (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_LOG2_FP32") ; + case GB_FP64_code : return ("GxB_LOG2_FP64") ; + case GB_FC32_code : return ("GxB_LOG2_FC32") ; + case GB_FC64_code : return ("GxB_LOG2_FC64") ; + default :; + } + break ; + + case GB_LGAMMA_unop_code : // z = lgamma (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_LGAMMA_FP32") ; + case GB_FP64_code : return ("GxB_LGAMMA_FP64") ; + default :; + } + break ; + + case GB_TGAMMA_unop_code : // z = tgamma (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_TGAMMA_FP32") ; + case GB_FP64_code : return ("GxB_TGAMMA_FP64") ; + default :; + } + break ; + + case GB_ERF_unop_code : // z = erf (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ERF_FP32") ; + case GB_FP64_code : return ("GxB_ERF_FP64") ; + default :; + } + break ; + + case GB_ERFC_unop_code : // z = erfc (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ERFC_FP32") ; + case GB_FP64_code : return ("GxB_ERFC_FP64") ; + default :; + } + break ; + + case GB_CBRT_unop_code : // z = cbrt (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_CBRT_FP32") ; + case GB_FP64_code : return ("GxB_CBRT_FP64") ; + default :; + } + break ; + + case GB_FREXPX_unop_code : // z = frexpx (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_FREXPX_FP32") ; + case GB_FP64_code : return ("GxB_FREXPX_FP64") ; + default :; + } + break ; + + case GB_FREXPE_unop_code : // z = frexpe (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_FREXPE_FP32") ; + case GB_FP64_code : return ("GxB_FREXPE_FP64") ; + default :; + } + break ; + + case GB_CONJ_unop_code : // z = conj (x) + + switch (xcode) + { + case GB_FC32_code : return ("GxB_CONJ_FC32") ; + case GB_FC64_code : return ("GxB_CONJ_FC64") ; + default :; + } + break ; + + case GB_CREAL_unop_code : // z = creal (x) + + switch (xcode) + { + case GB_FC32_code : return ("GxB_CREAL_FC32") ; + case GB_FC64_code : return ("GxB_CREAL_FC64") ; + default :; + } + break ; + + case GB_CIMAG_unop_code : // z = cimag (x) + + switch (xcode) + { + case GB_FC32_code : return ("GxB_CIMAG_FC32") ; + case GB_FC64_code : return ("GxB_CIMAG_FC64") ; + default :; + } + break ; + + case GB_CARG_unop_code : // z = carg (x) + + switch (xcode) + { + case GB_FC32_code : return ("GxB_CARG_FC32") ; + case GB_FC64_code : return ("GxB_CARG_FC64") ; + default :; + } + break ; + + case GB_ISINF_unop_code : // z = isinf (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ISINF_FP32") ; + case GB_FP64_code : return ("GxB_ISINF_FP64") ; + case GB_FC32_code : return ("GxB_ISINF_FC32") ; + case GB_FC64_code : return ("GxB_ISINF_FC64") ; + default :; + } + break ; + + case GB_ISNAN_unop_code : // z = isnan (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ISNAN_FP32") ; + case GB_FP64_code : return ("GxB_ISNAN_FP64") ; + case GB_FC32_code : return ("GxB_ISNAN_FC32") ; + case GB_FC64_code : return ("GxB_ISNAN_FC64") ; + default :; + } + break ; + + case GB_ISFINITE_unop_code : // z = isfinite (x) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ISFINITE_FP32") ; + case GB_FP64_code : return ("GxB_ISFINITE_FP64") ; + case GB_FC32_code : return ("GxB_ISFINITE_FC32") ; + case GB_FC64_code : return ("GxB_ISFINITE_FC64") ; + default :; + } + break ; + + case GB_POSITIONI_unop_code : // z = position_i(A(i,j)) == i + + switch (zcode) + { + case GB_INT32_code : return ("GxB_POSITIONI_INT32") ; + case GB_INT64_code : return ("GxB_POSITIONI_INT64") ; + default :; + } + break ; + + case GB_POSITIONI1_unop_code : // z = position_i1(A(i,j)) == i+1 + + switch (zcode) + { + case GB_INT32_code : return ("GxB_POSITIONI1_INT32") ; + case GB_INT64_code : return ("GxB_POSITIONI1_INT64") ; + default :; + } + break ; + + case GB_POSITIONJ_unop_code : // z = position_j(A(i,j)) == j + + switch (zcode) + { + case GB_INT32_code : return ("GxB_POSITIONJ_INT32") ; + case GB_INT64_code : return ("GxB_POSITIONJ_INT64") ; + default :; + } + break ; + + case GB_POSITIONJ1_unop_code : // z = position_j1(A(i,j)) == j+1 + + switch (zcode) + { + case GB_INT32_code : return ("GxB_POSITIONJ1_INT32") ; + case GB_INT64_code : return ("GxB_POSITIONJ1_INT64") ; + default :; + } + break ; + + //---------------------------------------------------------------------- + // index_unary operators + //---------------------------------------------------------------------- + + case GB_ROWINDEX_idxunop_code : // (i+thunk): row index - thunk + + switch (zcode) + { + case GB_INT32_code : return ("GrB_ROWINDEX_INT32") ; + case GB_INT64_code : return ("GrB_ROWINDEX_INT64") ; + default :; + } + break ; + + case GB_COLINDEX_idxunop_code : // (j+thunk): col index - thunk + + switch (zcode) + { + case GB_INT32_code : return ("GrB_COLINDEX_INT32") ; + case GB_INT64_code : return ("GrB_COLINDEX_INT64") ; + default :; + } + break ; + + case GB_DIAGINDEX_idxunop_code : // (j-(i+thunk)): diag index+thunk + + switch (zcode) + { + case GB_INT32_code : return ("GrB_DIAGINDEX_INT32") ; + case GB_INT64_code : return ("GrB_DIAGINDEX_INT64") ; + default :; + } + break ; + + case GB_FLIPDIAGINDEX_idxunop_code : // (i-(j+thunk)), internal use only + + switch (zcode) + { + case GB_INT32_code : return ("GxB_FLIPDIAGINDEX_INT32") ; + case GB_INT64_code : return ("GxB_FLIPDIAGINDEX_INT64") ; + default :; + } + break ; + + case GB_TRIL_idxunop_code : return ("GrB_TRIL" ) ; + case GB_TRIU_idxunop_code : return ("GrB_TRIU" ) ; + case GB_DIAG_idxunop_code : return ("GrB_DIAG" ) ; + case GB_OFFDIAG_idxunop_code : return ("GrB_OFFDIAG") ; + case GB_COLLE_idxunop_code : return ("GrB_COLLE" ) ; + case GB_COLGT_idxunop_code : return ("GrB_COLGT" ) ; + case GB_ROWLE_idxunop_code : return ("GrB_ROWLE" ) ; + case GB_ROWGT_idxunop_code : return ("GrB_ROWGT" ) ; + + case GB_NONZOMBIE_idxunop_code : return ("GxB_NONZOMBIE") ; + + case GB_VALUENE_idxunop_code : // (aij != thunk) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_VALUENE_BOOL" ) ; + case GB_INT8_code : return ("GrB_VALUENE_INT8" ) ; + case GB_INT16_code : return ("GrB_VALUENE_INT16" ) ; + case GB_INT32_code : return ("GrB_VALUENE_INT32" ) ; + case GB_INT64_code : return ("GrB_VALUENE_INT64" ) ; + case GB_UINT8_code : return ("GrB_VALUENE_UINT8" ) ; + case GB_UINT16_code : return ("GrB_VALUENE_UINT16") ; + case GB_UINT32_code : return ("GrB_VALUENE_UINT32") ; + case GB_UINT64_code : return ("GrB_VALUENE_UINT64") ; + case GB_FP32_code : return ("GrB_VALUENE_FP32" ) ; + case GB_FP64_code : return ("GrB_VALUENE_FP64" ) ; + case GB_FC32_code : return ("GxB_VALUENE_FC32" ) ; + case GB_FC64_code : return ("GxB_VALUENE_FC64" ) ; + default :; + } + break ; + + case GB_VALUEEQ_idxunop_code : // (aij == thunk) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_VALUEEQ_BOOL" ) ; + case GB_INT8_code : return ("GrB_VALUEEQ_INT8" ) ; + case GB_INT16_code : return ("GrB_VALUEEQ_INT16" ) ; + case GB_INT32_code : return ("GrB_VALUEEQ_INT32" ) ; + case GB_INT64_code : return ("GrB_VALUEEQ_INT64" ) ; + case GB_UINT8_code : return ("GrB_VALUEEQ_UINT8" ) ; + case GB_UINT16_code : return ("GrB_VALUEEQ_UINT16") ; + case GB_UINT32_code : return ("GrB_VALUEEQ_UINT32") ; + case GB_UINT64_code : return ("GrB_VALUEEQ_UINT64") ; + case GB_FP32_code : return ("GrB_VALUEEQ_FP32" ) ; + case GB_FP64_code : return ("GrB_VALUEEQ_FP64" ) ; + case GB_FC32_code : return ("GxB_VALUEEQ_FC32" ) ; + case GB_FC64_code : return ("GxB_VALUEEQ_FC64" ) ; + default :; + } + break ; + + case GB_VALUEGT_idxunop_code : // (aij > thunk) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_VALUEGT_BOOL" ) ; + case GB_INT8_code : return ("GrB_VALUEGT_INT8" ) ; + case GB_INT16_code : return ("GrB_VALUEGT_INT16" ) ; + case GB_INT32_code : return ("GrB_VALUEGT_INT32" ) ; + case GB_INT64_code : return ("GrB_VALUEGT_INT64" ) ; + case GB_UINT8_code : return ("GrB_VALUEGT_UINT8" ) ; + case GB_UINT16_code : return ("GrB_VALUEGT_UINT16") ; + case GB_UINT32_code : return ("GrB_VALUEGT_UINT32") ; + case GB_UINT64_code : return ("GrB_VALUEGT_UINT64") ; + case GB_FP32_code : return ("GrB_VALUEGT_FP32" ) ; + case GB_FP64_code : return ("GrB_VALUEGT_FP64" ) ; + default :; + } + break ; + + case GB_VALUEGE_idxunop_code : // (aij >= thunk) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_VALUEGE_BOOL" ) ; + case GB_INT8_code : return ("GrB_VALUEGE_INT8" ) ; + case GB_INT16_code : return ("GrB_VALUEGE_INT16" ) ; + case GB_INT32_code : return ("GrB_VALUEGE_INT32" ) ; + case GB_INT64_code : return ("GrB_VALUEGE_INT64" ) ; + case GB_UINT8_code : return ("GrB_VALUEGE_UINT8" ) ; + case GB_UINT16_code : return ("GrB_VALUEGE_UINT16") ; + case GB_UINT32_code : return ("GrB_VALUEGE_UINT32") ; + case GB_UINT64_code : return ("GrB_VALUEGE_UINT64") ; + case GB_FP32_code : return ("GrB_VALUEGE_FP32" ) ; + case GB_FP64_code : return ("GrB_VALUEGE_FP64" ) ; + default :; + } + break ; + + case GB_VALUELT_idxunop_code : // (aij < thunk) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_VALUELT_BOOL" ) ; + case GB_INT8_code : return ("GrB_VALUELT_INT8" ) ; + case GB_INT16_code : return ("GrB_VALUELT_INT16" ) ; + case GB_INT32_code : return ("GrB_VALUELT_INT32" ) ; + case GB_INT64_code : return ("GrB_VALUELT_INT64" ) ; + case GB_UINT8_code : return ("GrB_VALUELT_UINT8" ) ; + case GB_UINT16_code : return ("GrB_VALUELT_UINT16") ; + case GB_UINT32_code : return ("GrB_VALUELT_UINT32") ; + case GB_UINT64_code : return ("GrB_VALUELT_UINT64") ; + case GB_FP32_code : return ("GrB_VALUELT_FP32" ) ; + case GB_FP64_code : return ("GrB_VALUELT_FP64" ) ; + default :; + } + break ; + + case GB_VALUELE_idxunop_code : // (aij <= thunk) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_VALUELE_BOOL" ) ; + case GB_INT8_code : return ("GrB_VALUELE_INT8" ) ; + case GB_INT16_code : return ("GrB_VALUELE_INT16" ) ; + case GB_INT32_code : return ("GrB_VALUELE_INT32" ) ; + case GB_INT64_code : return ("GrB_VALUELE_INT64" ) ; + case GB_UINT8_code : return ("GrB_VALUELE_UINT8" ) ; + case GB_UINT16_code : return ("GrB_VALUELE_UINT16") ; + case GB_UINT32_code : return ("GrB_VALUELE_UINT32") ; + case GB_UINT64_code : return ("GrB_VALUELE_UINT64") ; + case GB_FP32_code : return ("GrB_VALUELE_FP32" ) ; + case GB_FP64_code : return ("GrB_VALUELE_FP64" ) ; + default :; + } + break ; + + //---------------------------------------------------------------------- + // binary operators + //---------------------------------------------------------------------- + + case GB_FIRST_binop_code : // z = x + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_FIRST_BOOL" ) ; + case GB_INT8_code : return ("GrB_FIRST_INT8" ) ; + case GB_INT16_code : return ("GrB_FIRST_INT16" ) ; + case GB_INT32_code : return ("GrB_FIRST_INT32" ) ; + case GB_INT64_code : return ("GrB_FIRST_INT64" ) ; + case GB_UINT8_code : return ("GrB_FIRST_UINT8" ) ; + case GB_UINT16_code : return ("GrB_FIRST_UINT16") ; + case GB_UINT32_code : return ("GrB_FIRST_UINT32") ; + case GB_UINT64_code : return ("GrB_FIRST_UINT64") ; + case GB_FP32_code : return ("GrB_FIRST_FP32" ) ; + case GB_FP64_code : return ("GrB_FIRST_FP64" ) ; + case GB_FC32_code : return ("GxB_FIRST_FC32" ) ; + case GB_FC64_code : return ("GxB_FIRST_FC64" ) ; + // see GB_reduce_to_vector: +// case GB_UDT_code : +// return ("1st_udt") ; + default :; + } + break ; + + case GB_SECOND_binop_code : // z = y + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_SECOND_BOOL" ) ; + case GB_INT8_code : return ("GrB_SECOND_INT8" ) ; + case GB_INT16_code : return ("GrB_SECOND_INT16" ) ; + case GB_INT32_code : return ("GrB_SECOND_INT32" ) ; + case GB_INT64_code : return ("GrB_SECOND_INT64" ) ; + case GB_UINT8_code : return ("GrB_SECOND_UINT8" ) ; + case GB_UINT16_code : return ("GrB_SECOND_UINT16") ; + case GB_UINT32_code : return ("GrB_SECOND_UINT32") ; + case GB_UINT64_code : return ("GrB_SECOND_UINT64") ; + case GB_FP32_code : return ("GrB_SECOND_FP32" ) ; + case GB_FP64_code : return ("GrB_SECOND_FP64" ) ; + case GB_FC32_code : return ("GxB_SECOND_FC32" ) ; + case GB_FC64_code : return ("GxB_SECOND_FC64" ) ; + // see GB_binop_second: +// case GB_UDT_code : +// return ("2nd_udt") ; + default :; + } + break ; + + case GB_ANY_binop_code : // z = x or y + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_ANY_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_UINT32") ; + case GB_UINT64_code : return ("GxB_ANY_UINT64") ; + case GB_FP32_code : return ("GxB_ANY_FP32" ) ; + case GB_FP64_code : return ("GxB_ANY_FP64" ) ; + case GB_FC32_code : return ("GxB_ANY_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_FC64" ) ; + default :; + } + break ; + + case GB_PAIR_binop_code : // z = 1 + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_ONEB_BOOL" ) ; + case GB_INT8_code : return ("GrB_ONEB_INT8" ) ; + case GB_INT16_code : return ("GrB_ONEB_INT16" ) ; + case GB_INT32_code : return ("GrB_ONEB_INT32" ) ; + case GB_INT64_code : return ("GrB_ONEB_INT64" ) ; + case GB_UINT8_code : return ("GrB_ONEB_UINT8" ) ; + case GB_UINT16_code : return ("GrB_ONEB_UINT16") ; + case GB_UINT32_code : return ("GrB_ONEB_UINT32") ; + case GB_UINT64_code : return ("GrB_ONEB_UINT64") ; + case GB_FP32_code : return ("GrB_ONEB_FP32" ) ; + case GB_FP64_code : return ("GrB_ONEB_FP64" ) ; + case GB_FC32_code : return ("GxB_ONEB_FC32" ) ; + case GB_FC64_code : return ("GxB_ONEB_FC64" ) ; + default :; + } + break ; + + case GB_MIN_binop_code : // z = min(x,y) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_MIN_BOOL" ) ; + case GB_INT8_code : return ("GrB_MIN_INT8" ) ; + case GB_INT16_code : return ("GrB_MIN_INT16" ) ; + case GB_INT32_code : return ("GrB_MIN_INT32" ) ; + case GB_INT64_code : return ("GrB_MIN_INT64" ) ; + case GB_UINT8_code : return ("GrB_MIN_UINT8" ) ; + case GB_UINT16_code : return ("GrB_MIN_UINT16") ; + case GB_UINT32_code : return ("GrB_MIN_UINT32") ; + case GB_UINT64_code : return ("GrB_MIN_UINT64") ; + case GB_FP32_code : return ("GrB_MIN_FP32" ) ; + case GB_FP64_code : return ("GrB_MIN_FP64" ) ; + default :; + } + break ; + + case GB_MAX_binop_code : // z = max(x,y) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_MAX_BOOL" ) ; + case GB_INT8_code : return ("GrB_MAX_INT8" ) ; + case GB_INT16_code : return ("GrB_MAX_INT16" ) ; + case GB_INT32_code : return ("GrB_MAX_INT32" ) ; + case GB_INT64_code : return ("GrB_MAX_INT64" ) ; + case GB_UINT8_code : return ("GrB_MAX_UINT8" ) ; + case GB_UINT16_code : return ("GrB_MAX_UINT16") ; + case GB_UINT32_code : return ("GrB_MAX_UINT32") ; + case GB_UINT64_code : return ("GrB_MAX_UINT64") ; + case GB_FP32_code : return ("GrB_MAX_FP32" ) ; + case GB_FP64_code : return ("GrB_MAX_FP64" ) ; + default :; + } + break ; + + case GB_PLUS_binop_code : // z = x + y + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_PLUS_BOOL" ) ; + case GB_INT8_code : return ("GrB_PLUS_INT8" ) ; + case GB_INT16_code : return ("GrB_PLUS_INT16" ) ; + case GB_INT32_code : return ("GrB_PLUS_INT32" ) ; + case GB_INT64_code : return ("GrB_PLUS_INT64" ) ; + case GB_UINT8_code : return ("GrB_PLUS_UINT8" ) ; + case GB_UINT16_code : return ("GrB_PLUS_UINT16") ; + case GB_UINT32_code : return ("GrB_PLUS_UINT32") ; + case GB_UINT64_code : return ("GrB_PLUS_UINT64") ; + case GB_FP32_code : return ("GrB_PLUS_FP32" ) ; + case GB_FP64_code : return ("GrB_PLUS_FP64" ) ; + case GB_FC32_code : return ("GxB_PLUS_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_FC64" ) ; + default :; + } + break ; + + case GB_MINUS_binop_code : // z = x - y + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_MINUS_BOOL" ) ; + case GB_INT8_code : return ("GrB_MINUS_INT8" ) ; + case GB_INT16_code : return ("GrB_MINUS_INT16" ) ; + case GB_INT32_code : return ("GrB_MINUS_INT32" ) ; + case GB_INT64_code : return ("GrB_MINUS_INT64" ) ; + case GB_UINT8_code : return ("GrB_MINUS_UINT8" ) ; + case GB_UINT16_code : return ("GrB_MINUS_UINT16") ; + case GB_UINT32_code : return ("GrB_MINUS_UINT32") ; + case GB_UINT64_code : return ("GrB_MINUS_UINT64") ; + case GB_FP32_code : return ("GrB_MINUS_FP32" ) ; + case GB_FP64_code : return ("GrB_MINUS_FP64" ) ; + case GB_FC32_code : return ("GxB_MINUS_FC32" ) ; + case GB_FC64_code : return ("GxB_MINUS_FC64" ) ; + default :; + } + break ; + + case GB_RMINUS_binop_code : // z = y - x + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_RMINUS_BOOL" ) ; + case GB_INT8_code : return ("GxB_RMINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_RMINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_RMINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_RMINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_RMINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_RMINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_RMINUS_UINT32") ; + case GB_UINT64_code : return ("GxB_RMINUS_UINT64") ; + case GB_FP32_code : return ("GxB_RMINUS_FP32" ) ; + case GB_FP64_code : return ("GxB_RMINUS_FP64" ) ; + case GB_FC32_code : return ("GxB_RMINUS_FC32" ) ; + case GB_FC64_code : return ("GxB_RMINUS_FC64" ) ; + default :; + } + break ; + + case GB_TIMES_binop_code : // z = x * y + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_TIMES_BOOL" ) ; + case GB_INT8_code : return ("GrB_TIMES_INT8" ) ; + case GB_INT16_code : return ("GrB_TIMES_INT16" ) ; + case GB_INT32_code : return ("GrB_TIMES_INT32" ) ; + case GB_INT64_code : return ("GrB_TIMES_INT64" ) ; + case GB_UINT8_code : return ("GrB_TIMES_UINT8" ) ; + case GB_UINT16_code : return ("GrB_TIMES_UINT16") ; + case GB_UINT32_code : return ("GrB_TIMES_UINT32") ; + case GB_UINT64_code : return ("GrB_TIMES_UINT64") ; + case GB_FP32_code : return ("GrB_TIMES_FP32" ) ; + case GB_FP64_code : return ("GrB_TIMES_FP64" ) ; + case GB_FC32_code : return ("GxB_TIMES_FC32" ) ; + case GB_FC64_code : return ("GxB_TIMES_FC64" ) ; + default :; + } + break ; + + case GB_DIV_binop_code : // z = x / y + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_DIV_BOOL" ) ; + case GB_INT8_code : return ("GrB_DIV_INT8" ) ; + case GB_INT16_code : return ("GrB_DIV_INT16" ) ; + case GB_INT32_code : return ("GrB_DIV_INT32" ) ; + case GB_INT64_code : return ("GrB_DIV_INT64" ) ; + case GB_UINT8_code : return ("GrB_DIV_UINT8" ) ; + case GB_UINT16_code : return ("GrB_DIV_UINT16") ; + case GB_UINT32_code : return ("GrB_DIV_UINT32") ; + case GB_UINT64_code : return ("GrB_DIV_UINT64") ; + case GB_FP32_code : return ("GrB_DIV_FP32" ) ; + case GB_FP64_code : return ("GrB_DIV_FP64" ) ; + case GB_FC32_code : return ("GxB_DIV_FC32" ) ; + case GB_FC64_code : return ("GxB_DIV_FC64" ) ; + default :; + } + break ; + + case GB_RDIV_binop_code : // z = y / x + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_RDIV_BOOL" ) ; + case GB_INT8_code : return ("GxB_RDIV_INT8" ) ; + case GB_INT16_code : return ("GxB_RDIV_INT16" ) ; + case GB_INT32_code : return ("GxB_RDIV_INT32" ) ; + case GB_INT64_code : return ("GxB_RDIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_RDIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_RDIV_UINT16") ; + case GB_UINT32_code : return ("GxB_RDIV_UINT32") ; + case GB_UINT64_code : return ("GxB_RDIV_UINT64") ; + case GB_FP32_code : return ("GxB_RDIV_FP32" ) ; + case GB_FP64_code : return ("GxB_RDIV_FP64" ) ; + case GB_FC32_code : return ("GxB_RDIV_FC32" ) ; + case GB_FC64_code : return ("GxB_RDIV_FC64" ) ; + default :; + } + break ; + + case GB_POW_binop_code : // z = pow (x,y) + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_POW_BOOL" ) ; + case GB_INT8_code : return ("GxB_POW_INT8" ) ; + case GB_INT16_code : return ("GxB_POW_INT16" ) ; + case GB_INT32_code : return ("GxB_POW_INT32" ) ; + case GB_INT64_code : return ("GxB_POW_INT64" ) ; + case GB_UINT8_code : return ("GxB_POW_UINT8" ) ; + case GB_UINT16_code : return ("GxB_POW_UINT16") ; + case GB_UINT32_code : return ("GxB_POW_UINT32") ; + case GB_UINT64_code : return ("GxB_POW_UINT64") ; + case GB_FP32_code : return ("GxB_POW_FP32" ) ; + case GB_FP64_code : return ("GxB_POW_FP64" ) ; + case GB_FC32_code : return ("GxB_POW_FC32" ) ; + case GB_FC64_code : return ("GxB_POW_FC64" ) ; + default :; + } + break ; + + case GB_ISEQ_binop_code : // z = (x == y) + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_ISEQ_BOOL" ) ; + case GB_INT8_code : return ("GxB_ISEQ_INT8" ) ; + case GB_INT16_code : return ("GxB_ISEQ_INT16" ) ; + case GB_INT32_code : return ("GxB_ISEQ_INT32" ) ; + case GB_INT64_code : return ("GxB_ISEQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_ISEQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ISEQ_UINT16") ; + case GB_UINT32_code : return ("GxB_ISEQ_UINT32") ; + case GB_UINT64_code : return ("GxB_ISEQ_UINT64") ; + case GB_FP32_code : return ("GxB_ISEQ_FP32" ) ; + case GB_FP64_code : return ("GxB_ISEQ_FP64" ) ; + case GB_FC32_code : return ("GxB_ISEQ_FC32" ) ; + case GB_FC64_code : return ("GxB_ISEQ_FC64" ) ; + default :; + } + break ; + + case GB_ISNE_binop_code : // z = (x != y) + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_ISNE_BOOL" ) ; + case GB_INT8_code : return ("GxB_ISNE_INT8" ) ; + case GB_INT16_code : return ("GxB_ISNE_INT16" ) ; + case GB_INT32_code : return ("GxB_ISNE_INT32" ) ; + case GB_INT64_code : return ("GxB_ISNE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ISNE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ISNE_UINT16") ; + case GB_UINT32_code : return ("GxB_ISNE_UINT32") ; + case GB_UINT64_code : return ("GxB_ISNE_UINT64") ; + case GB_FP32_code : return ("GxB_ISNE_FP32" ) ; + case GB_FP64_code : return ("GxB_ISNE_FP64" ) ; + case GB_FC32_code : return ("GxB_ISNE_FC32" ) ; + case GB_FC64_code : return ("GxB_ISNE_FC64" ) ; + default :; + } + break ; + + case GB_ISGT_binop_code : // z = (x > y) + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_ISGT_BOOL" ) ; + case GB_INT8_code : return ("GxB_ISGT_INT8" ) ; + case GB_INT16_code : return ("GxB_ISGT_INT16" ) ; + case GB_INT32_code : return ("GxB_ISGT_INT32" ) ; + case GB_INT64_code : return ("GxB_ISGT_INT64" ) ; + case GB_UINT8_code : return ("GxB_ISGT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ISGT_UINT16") ; + case GB_UINT32_code : return ("GxB_ISGT_UINT32") ; + case GB_UINT64_code : return ("GxB_ISGT_UINT64") ; + case GB_FP32_code : return ("GxB_ISGT_FP32" ) ; + case GB_FP64_code : return ("GxB_ISGT_FP64" ) ; + default :; + } + break ; + + case GB_ISLT_binop_code : // z = (x < y) + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_ISLT_BOOL" ) ; + case GB_INT8_code : return ("GxB_ISLT_INT8" ) ; + case GB_INT16_code : return ("GxB_ISLT_INT16" ) ; + case GB_INT32_code : return ("GxB_ISLT_INT32" ) ; + case GB_INT64_code : return ("GxB_ISLT_INT64" ) ; + case GB_UINT8_code : return ("GxB_ISLT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ISLT_UINT16") ; + case GB_UINT32_code : return ("GxB_ISLT_UINT32") ; + case GB_UINT64_code : return ("GxB_ISLT_UINT64") ; + case GB_FP32_code : return ("GxB_ISLT_FP32" ) ; + case GB_FP64_code : return ("GxB_ISLT_FP64" ) ; + default :; + } + break ; + + case GB_ISGE_binop_code : // z = (x >= y) + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_ISGE_BOOL" ) ; + case GB_INT8_code : return ("GxB_ISGE_INT8" ) ; + case GB_INT16_code : return ("GxB_ISGE_INT16" ) ; + case GB_INT32_code : return ("GxB_ISGE_INT32" ) ; + case GB_INT64_code : return ("GxB_ISGE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ISGE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ISGE_UINT16") ; + case GB_UINT32_code : return ("GxB_ISGE_UINT32") ; + case GB_UINT64_code : return ("GxB_ISGE_UINT64") ; + case GB_FP32_code : return ("GxB_ISGE_FP32" ) ; + case GB_FP64_code : return ("GxB_ISGE_FP64" ) ; + default :; + } + break ; + + case GB_ISLE_binop_code : // z = (x <= y) + + switch (xcode) + { + case GB_BOOL_code : return ("GxB_ISLE_BOOL" ) ; + case GB_INT8_code : return ("GxB_ISLE_INT8" ) ; + case GB_INT16_code : return ("GxB_ISLE_INT16" ) ; + case GB_INT32_code : return ("GxB_ISLE_INT32" ) ; + case GB_INT64_code : return ("GxB_ISLE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ISLE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ISLE_UINT16") ; + case GB_UINT32_code : return ("GxB_ISLE_UINT32") ; + case GB_UINT64_code : return ("GxB_ISLE_UINT64") ; + case GB_FP32_code : return ("GxB_ISLE_FP32" ) ; + case GB_FP64_code : return ("GxB_ISLE_FP64" ) ; + default :; + } + break ; + + case GB_LOR_binop_code : // z = (x != 0) || (y != 0) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_LOR" ) ; + case GB_INT8_code : return ("GxB_LOR_INT8" ) ; + case GB_INT16_code : return ("GxB_LOR_INT16" ) ; + case GB_INT32_code : return ("GxB_LOR_INT32" ) ; + case GB_INT64_code : return ("GxB_LOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_LOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LOR_UINT16") ; + case GB_UINT32_code : return ("GxB_LOR_UINT32") ; + case GB_UINT64_code : return ("GxB_LOR_UINT64") ; + case GB_FP32_code : return ("GxB_LOR_FP32" ) ; + case GB_FP64_code : return ("GxB_LOR_FP64" ) ; + default :; + } + break ; + + case GB_LAND_binop_code : // z = (x != 0) && (y != 0) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_LAND" ) ; + case GB_INT8_code : return ("GxB_LAND_INT8" ) ; + case GB_INT16_code : return ("GxB_LAND_INT16" ) ; + case GB_INT32_code : return ("GxB_LAND_INT32" ) ; + case GB_INT64_code : return ("GxB_LAND_INT64" ) ; + case GB_UINT8_code : return ("GxB_LAND_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LAND_UINT16") ; + case GB_UINT32_code : return ("GxB_LAND_UINT32") ; + case GB_UINT64_code : return ("GxB_LAND_UINT64") ; + case GB_FP32_code : return ("GxB_LAND_FP32" ) ; + case GB_FP64_code : return ("GxB_LAND_FP64" ) ; + default :; + } + break ; + + case GB_LXOR_binop_code : // z = (x != 0) != (y != 0) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_LXOR" ) ; + case GB_INT8_code : return ("GxB_LXOR_INT8" ) ; + case GB_INT16_code : return ("GxB_LXOR_INT16" ) ; + case GB_INT32_code : return ("GxB_LXOR_INT32" ) ; + case GB_INT64_code : return ("GxB_LXOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_LXOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LXOR_UINT16") ; + case GB_UINT32_code : return ("GxB_LXOR_UINT32") ; + case GB_UINT64_code : return ("GxB_LXOR_UINT64") ; + case GB_FP32_code : return ("GxB_LXOR_FP32" ) ; + case GB_FP64_code : return ("GxB_LXOR_FP64" ) ; + default :; + } + break ; + + case GB_EQ_binop_code : // z = (x == y), is LXNOR for bool + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_LXNOR" ) ; + case GB_INT8_code : return ("GrB_EQ_INT8" ) ; + case GB_INT16_code : return ("GrB_EQ_INT16" ) ; + case GB_INT32_code : return ("GrB_EQ_INT32" ) ; + case GB_INT64_code : return ("GrB_EQ_INT64" ) ; + case GB_UINT8_code : return ("GrB_EQ_UINT8" ) ; + case GB_UINT16_code : return ("GrB_EQ_UINT16") ; + case GB_UINT32_code : return ("GrB_EQ_UINT32") ; + case GB_UINT64_code : return ("GrB_EQ_UINT64") ; + case GB_FP32_code : return ("GrB_EQ_FP32" ) ; + case GB_FP64_code : return ("GrB_EQ_FP64" ) ; + case GB_FC32_code : return ("GxB_EQ_FC32" ) ; + case GB_FC64_code : return ("GxB_EQ_FC64" ) ; + default :; + } + break ; + + case GB_BOR_binop_code : // z = (x | y), bitwise or + + switch (xcode) + { + case GB_INT8_code : return ("GrB_BOR_INT8" ) ; + case GB_INT16_code : return ("GrB_BOR_INT16" ) ; + case GB_INT32_code : return ("GrB_BOR_INT32" ) ; + case GB_INT64_code : return ("GrB_BOR_INT64" ) ; + case GB_UINT8_code : return ("GrB_BOR_UINT8" ) ; + case GB_UINT16_code : return ("GrB_BOR_UINT16") ; + case GB_UINT32_code : return ("GrB_BOR_UINT32") ; + case GB_UINT64_code : return ("GrB_BOR_UINT64") ; + default :; + } + break ; + + case GB_BAND_binop_code : // z = (x & y), bitwise and + + switch (xcode) + { + case GB_INT8_code : return ("GrB_BAND_INT8" ) ; + case GB_INT16_code : return ("GrB_BAND_INT16" ) ; + case GB_INT32_code : return ("GrB_BAND_INT32" ) ; + case GB_INT64_code : return ("GrB_BAND_INT64" ) ; + case GB_UINT8_code : return ("GrB_BAND_UINT8" ) ; + case GB_UINT16_code : return ("GrB_BAND_UINT16") ; + case GB_UINT32_code : return ("GrB_BAND_UINT32") ; + case GB_UINT64_code : return ("GrB_BAND_UINT64") ; + default :; + } + break ; + + case GB_BXOR_binop_code : // z = (x ^ y), bitwise xor + + switch (xcode) + { + case GB_INT8_code : return ("GrB_BXOR_INT8" ) ; + case GB_INT16_code : return ("GrB_BXOR_INT16" ) ; + case GB_INT32_code : return ("GrB_BXOR_INT32" ) ; + case GB_INT64_code : return ("GrB_BXOR_INT64" ) ; + case GB_UINT8_code : return ("GrB_BXOR_UINT8" ) ; + case GB_UINT16_code : return ("GrB_BXOR_UINT16") ; + case GB_UINT32_code : return ("GrB_BXOR_UINT32") ; + case GB_UINT64_code : return ("GrB_BXOR_UINT64") ; + default :; + } + break ; + + case GB_BXNOR_binop_code : // z = ~(x ^ y), bitwise xnor + + switch (xcode) + { + case GB_INT8_code : return ("GrB_BXNOR_INT8" ) ; + case GB_INT16_code : return ("GrB_BXNOR_INT16" ) ; + case GB_INT32_code : return ("GrB_BXNOR_INT32" ) ; + case GB_INT64_code : return ("GrB_BXNOR_INT64" ) ; + case GB_UINT8_code : return ("GrB_BXNOR_UINT8" ) ; + case GB_UINT16_code : return ("GrB_BXNOR_UINT16") ; + case GB_UINT32_code : return ("GrB_BXNOR_UINT32") ; + case GB_UINT64_code : return ("GrB_BXNOR_UINT64") ; + default :; + } + break ; + + case GB_BGET_binop_code : // z = bitget (x,y) + + switch (xcode) + { + case GB_INT8_code : return ("GxB_BGET_INT8" ) ; + case GB_INT16_code : return ("GxB_BGET_INT16" ) ; + case GB_INT32_code : return ("GxB_BGET_INT32" ) ; + case GB_INT64_code : return ("GxB_BGET_INT64" ) ; + case GB_UINT8_code : return ("GxB_BGET_UINT8" ) ; + case GB_UINT16_code : return ("GxB_BGET_UINT16") ; + case GB_UINT32_code : return ("GxB_BGET_UINT32") ; + case GB_UINT64_code : return ("GxB_BGET_UINT64") ; + default :; + } + break ; + + case GB_BSET_binop_code : // z = bitset (x,y) + + switch (xcode) + { + case GB_INT8_code : return ("GxB_BSET_INT8" ) ; + case GB_INT16_code : return ("GxB_BSET_INT16" ) ; + case GB_INT32_code : return ("GxB_BSET_INT32" ) ; + case GB_INT64_code : return ("GxB_BSET_INT64" ) ; + case GB_UINT8_code : return ("GxB_BSET_UINT8" ) ; + case GB_UINT16_code : return ("GxB_BSET_UINT16") ; + case GB_UINT32_code : return ("GxB_BSET_UINT32") ; + case GB_UINT64_code : return ("GxB_BSET_UINT64") ; + default :; + } + break ; + + case GB_BCLR_binop_code : // z = bitclr (x,y) + + switch (xcode) + { + case GB_INT8_code : return ("GxB_BCLR_INT8" ) ; + case GB_INT16_code : return ("GxB_BCLR_INT16" ) ; + case GB_INT32_code : return ("GxB_BCLR_INT32" ) ; + case GB_INT64_code : return ("GxB_BCLR_INT64" ) ; + case GB_UINT8_code : return ("GxB_BCLR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_BCLR_UINT16") ; + case GB_UINT32_code : return ("GxB_BCLR_UINT32") ; + case GB_UINT64_code : return ("GxB_BCLR_UINT64") ; + default :; + } + break ; + + case GB_BSHIFT_binop_code : // z = bitshift (x,y) + + switch (xcode) + { + case GB_INT8_code : return ("GxB_BSHIFT_INT8" ) ; + case GB_INT16_code : return ("GxB_BSHIFT_INT16" ) ; + case GB_INT32_code : return ("GxB_BSHIFT_INT32" ) ; + case GB_INT64_code : return ("GxB_BSHIFT_INT64" ) ; + case GB_UINT8_code : return ("GxB_BSHIFT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_BSHIFT_UINT16") ; + case GB_UINT32_code : return ("GxB_BSHIFT_UINT32") ; + case GB_UINT64_code : return ("GxB_BSHIFT_UINT64") ; + default :; + } + break ; + + case GB_NE_binop_code : // z = (x != y) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_NE_BOOL" ) ; + case GB_INT8_code : return ("GrB_NE_INT8" ) ; + case GB_INT16_code : return ("GrB_NE_INT16" ) ; + case GB_INT32_code : return ("GrB_NE_INT32" ) ; + case GB_INT64_code : return ("GrB_NE_INT64" ) ; + case GB_UINT8_code : return ("GrB_NE_UINT8" ) ; + case GB_UINT16_code : return ("GrB_NE_UINT16") ; + case GB_UINT32_code : return ("GrB_NE_UINT32") ; + case GB_UINT64_code : return ("GrB_NE_UINT64") ; + case GB_FP32_code : return ("GrB_NE_FP32" ) ; + case GB_FP64_code : return ("GrB_NE_FP64" ) ; + case GB_FC32_code : return ("GxB_NE_FC32" ) ; + case GB_FC64_code : return ("GxB_NE_FC64" ) ; + default :; + } + break ; + + case GB_GT_binop_code : // z = (x > y) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_GT_BOOL" ) ; + case GB_INT8_code : return ("GrB_GT_INT8" ) ; + case GB_INT16_code : return ("GrB_GT_INT16" ) ; + case GB_INT32_code : return ("GrB_GT_INT32" ) ; + case GB_INT64_code : return ("GrB_GT_INT64" ) ; + case GB_UINT8_code : return ("GrB_GT_UINT8" ) ; + case GB_UINT16_code : return ("GrB_GT_UINT16") ; + case GB_UINT32_code : return ("GrB_GT_UINT32") ; + case GB_UINT64_code : return ("GrB_GT_UINT64") ; + case GB_FP32_code : return ("GrB_GT_FP32" ) ; + case GB_FP64_code : return ("GrB_GT_FP64" ) ; + default :; + } + break ; + + case GB_LT_binop_code : // z = (x < y) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_LT_BOOL" ) ; + case GB_INT8_code : return ("GrB_LT_INT8" ) ; + case GB_INT16_code : return ("GrB_LT_INT16" ) ; + case GB_INT32_code : return ("GrB_LT_INT32" ) ; + case GB_INT64_code : return ("GrB_LT_INT64" ) ; + case GB_UINT8_code : return ("GrB_LT_UINT8" ) ; + case GB_UINT16_code : return ("GrB_LT_UINT16") ; + case GB_UINT32_code : return ("GrB_LT_UINT32") ; + case GB_UINT64_code : return ("GrB_LT_UINT64") ; + case GB_FP32_code : return ("GrB_LT_FP32" ) ; + case GB_FP64_code : return ("GrB_LT_FP64" ) ; + default :; + } + break ; + + case GB_GE_binop_code : // z = (x >= y) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_GE_BOOL" ) ; + case GB_INT8_code : return ("GrB_GE_INT8" ) ; + case GB_INT16_code : return ("GrB_GE_INT16" ) ; + case GB_INT32_code : return ("GrB_GE_INT32" ) ; + case GB_INT64_code : return ("GrB_GE_INT64" ) ; + case GB_UINT8_code : return ("GrB_GE_UINT8" ) ; + case GB_UINT16_code : return ("GrB_GE_UINT16") ; + case GB_UINT32_code : return ("GrB_GE_UINT32") ; + case GB_UINT64_code : return ("GrB_GE_UINT64") ; + case GB_FP32_code : return ("GrB_GE_FP32" ) ; + case GB_FP64_code : return ("GrB_GE_FP64" ) ; + default :; + } + break ; + + case GB_LE_binop_code : // z = (x <= y) + + switch (xcode) + { + case GB_BOOL_code : return ("GrB_LE_BOOL" ) ; + case GB_INT8_code : return ("GrB_LE_INT8" ) ; + case GB_INT16_code : return ("GrB_LE_INT16" ) ; + case GB_INT32_code : return ("GrB_LE_INT32" ) ; + case GB_INT64_code : return ("GrB_LE_INT64" ) ; + case GB_UINT8_code : return ("GrB_LE_UINT8" ) ; + case GB_UINT16_code : return ("GrB_LE_UINT16") ; + case GB_UINT32_code : return ("GrB_LE_UINT32") ; + case GB_UINT64_code : return ("GrB_LE_UINT64") ; + case GB_FP32_code : return ("GrB_LE_FP32" ) ; + case GB_FP64_code : return ("GrB_LE_FP64" ) ; + default :; + } + break ; + + case GB_ATAN2_binop_code : // z = atan2 (x,y) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_ATAN2_FP32") ; + case GB_FP64_code : return ("GxB_ATAN2_FP64") ; + default :; + } + break ; + + case GB_HYPOT_binop_code : // z = hypot (x,y) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_HYPOT_FP32") ; + case GB_FP64_code : return ("GxB_HYPOT_FP64") ; + default :; + } + break ; + + case GB_FMOD_binop_code : // z = fmod (x,y) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_FMOD_FP32") ; + case GB_FP64_code : return ("GxB_FMOD_FP64") ; + default :; + } + break ; + + case GB_REMAINDER_binop_code : // z = remainder (x,y) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_REMAINDER_FP32") ; + case GB_FP64_code : return ("GxB_REMAINDER_FP64") ; + default :; + } + break ; + + case GB_COPYSIGN_binop_code : // z = copysign (x,y) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_COPYSIGN_FP32") ; + case GB_FP64_code : return ("GxB_COPYSIGN_FP64") ; + default :; + } + break ; + + case GB_LDEXP_binop_code : // z = ldexp (x,y) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_LDEXP_FP32") ; + case GB_FP64_code : return ("GxB_LDEXP_FP64") ; + default :; + } + break ; + + case GB_CMPLX_binop_code : // z = cmplx (x,y) + + switch (xcode) + { + case GB_FP32_code : return ("GxB_CMPLX_FP32") ; + case GB_FP64_code : return ("GxB_CMPLX_FP64") ; + default :; + } + break ; + + case GB_FIRSTI_binop_code : // z = first_i(A(i,j),y) == i + + switch (zcode) + { + case GB_INT32_code : return ("GxB_FIRSTI_INT32") ; + case GB_INT64_code : return ("GxB_FIRSTI_INT64") ; + default :; + } + break ; + + case GB_FIRSTI1_binop_code : // z = first_i1(A(i,j),y) == i+1 + + switch (zcode) + { + case GB_INT32_code : return ("GxB_FIRSTI1_INT32") ; + case GB_INT64_code : return ("GxB_FIRSTI1_INT64") ; + default :; + } + break ; + + case GB_FIRSTJ_binop_code : // z = first_j(A(i,j),y) == j + + switch (zcode) + { + case GB_INT32_code : return ("GxB_FIRSTJ_INT32") ; + case GB_INT64_code : return ("GxB_FIRSTJ_INT64") ; + default :; + } + break ; + + case GB_FIRSTJ1_binop_code : // z = first_j1(A(i,j),y) == j+1 + + switch (zcode) + { + case GB_INT32_code : return ("GxB_FIRSTJ1_INT32") ; + case GB_INT64_code : return ("GxB_FIRSTJ1_INT64") ; + default :; + } + break ; + + case GB_SECONDI_binop_code : // z = second_i(x,B(i,j)) == i + + switch (zcode) + { + case GB_INT32_code : return ("GxB_SECONDI_INT32") ; + case GB_INT64_code : return ("GxB_SECONDI_INT64") ; + default :; + } + break ; + + case GB_SECONDI1_binop_code : // z = second_i1(x,B(i,j)) == i+1 + + switch (zcode) + { + case GB_INT32_code : return ("GxB_SECONDI1_INT32") ; + case GB_INT64_code : return ("GxB_SECONDI1_INT64") ; + default :; + } + break ; + + case GB_SECONDJ_binop_code : // z = second_j(x,B(i,j)) == j + + switch (zcode) + { + case GB_INT32_code : return ("GxB_SECONDJ_INT32") ; + case GB_INT64_code : return ("GxB_SECONDJ_INT64") ; + default :; + } + break ; + + case GB_SECONDJ1_binop_code : // z = second_j1(x,B(i,j)) == j+1 + + switch (zcode) + { + case GB_INT32_code : return ("GxB_SECONDJ1_INT32") ; + case GB_INT64_code : return ("GxB_SECONDJ1_INT64") ; + default :; + } + break ; + + //---------------------------------------------------------------------- + // user-defined operators + //---------------------------------------------------------------------- + + case GB_USER_unop_code : + case GB_USER_idxunop_code : + case GB_USER_binop_code : return (op->user_name) ; + + //---------------------------------------------------------------------- + // operator not recognized + //---------------------------------------------------------------------- + + default :; + } + + return ("") ; +} + diff --git a/GraphBLAS/Source/GB_op_or_type_string_set.c b/GraphBLAS/Source/GB_op_or_type_string_set.c new file mode 100644 index 0000000000..2e44f32f0a --- /dev/null +++ b/GraphBLAS/Source/GB_op_or_type_string_set.c @@ -0,0 +1,115 @@ +//------------------------------------------------------------------------------ +// 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. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" +#include +#include "GB_jitifyer.h" + +GrB_Info GB_op_or_type_string_set +( + // input: + bool user_defined, + bool jitable, + char *value, + int field, + // output: + char **user_name, + size_t *user_name_size, + char *name, + int32_t *name_len, + char **defn, + size_t *defn_size, + uint64_t *hash +) +{ + + //-------------------------------------------------------------------------- + // quick return for built-in types and operators + //-------------------------------------------------------------------------- + + if (!user_defined) + { + // built-in type or operator + return (GrB_INVALID_VALUE) ; + } + + //-------------------------------------------------------------------------- + // set the name or defn of a user-defined type or operator + //-------------------------------------------------------------------------- + + size_t len = strlen (value) ; + bool compute_hash = false ; + + switch (field) + { + + case GrB_NAME : + + return (GB_user_name_set (user_name, user_name_size, value, true)) ; + + case GxB_JIT_C_NAME : + + if (name [0] != '\0') + { + return (GrB_ALREADY_SET) ; // GxB_JIT_C_NAME already set + } + + if (len == 0 || len >= GxB_MAX_NAME_LEN) + { + // invalid name: the name cannot be empty, and the name cannot + // exceed GxB_MAX_NAME_LEN-1 characters. + return (GrB_INVALID_VALUE) ; + } + + // set the name + strncpy (name, value, GxB_MAX_NAME_LEN-1) ; + name [GxB_MAX_NAME_LEN-1] = '\0' ; + (*name_len) = (int32_t) len ; + // compute the hash if the type defn has also been set + compute_hash = ((*defn) != NULL) ; + break ; + + case GxB_JIT_C_DEFINITION : + + if ((*defn) != NULL) + { + return (GrB_ALREADY_SET) ; // GxB_JIT_C_DEFINITION already set + } + + // allocate space for the definition + (*defn) = GB_MALLOC (len+1, char, defn_size) ; + if ((*defn) == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + + // copy the definition into the new operator + memcpy ((*defn), value, len+1) ; + // compute the hash if the type name has also been set + compute_hash = (name [0] != '[') ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + //-------------------------------------------------------------------------- + // compute the operator hash, if type->name and type->defn are now both set + //-------------------------------------------------------------------------- + + if (compute_hash) + { + // the type name and defn have been set + (*hash) = GB_jitifyer_hash (name, (*name_len), jitable) ; + } + + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GB_op_scalar_get.c b/GraphBLAS/Source/GB_op_scalar_get.c new file mode 100644 index 0000000000..74b9a8c9c9 --- /dev/null +++ b/GraphBLAS/Source/GB_op_scalar_get.c @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// GB_op_scalar_get: get a field in an op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_op_scalar_get +( + GB_Operator op, + GrB_Scalar value, + GrB_Field field, + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + 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, + GB_INT32_code, Werk) ; + } + return (info) ; +} + diff --git a/GraphBLAS/Source/GB_op_size_get.c b/GraphBLAS/Source/GB_op_size_get.c new file mode 100644 index 0000000000..a560de918d --- /dev/null +++ b/GraphBLAS/Source/GB_op_size_get.c @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------ +// GB_op_size_get: get the size of a string in an op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_op_size_get +( + GB_Operator op, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + const char *s ; + + switch ((int) field) + { + + case GxB_JIT_C_DEFINITION : + (*value) = (op->defn == NULL) ? 1 : (strlen (op->defn) + 1) ; + #pragma omp flush + return (GrB_SUCCESS) ; + + case GxB_JIT_C_NAME : + (*value) = strlen (op->name) + 1 ; + #pragma omp flush + return (GrB_SUCCESS) ; + + case GrB_NAME : + s = GB_op_name_get (op) ; + (*value) = (s == NULL) ? 1 : (strlen (s) + 1) ; + #pragma omp flush + return (GrB_SUCCESS) ; + + case GrB_INP0_TYPE_STRING : + s = GB_type_name_get (op->xtype) ; + break ; ; + + case GrB_INP1_TYPE_STRING : + s = GB_type_name_get (op->ytype) ; + break ; + + case GrB_OUTP_TYPE_STRING : + s = GB_type_name_get (op->ztype) ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + (*value) = (s == NULL) ? 1 : (strlen (s) + 1) ; + + #pragma omp flush + return ((s == NULL) ? GrB_NO_VALUE : GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GB_op_string_get.c b/GraphBLAS/Source/GB_op_string_get.c new file mode 100644 index 0000000000..6353c8afed --- /dev/null +++ b/GraphBLAS/Source/GB_op_string_get.c @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// GB_op_string_get: get a field in an op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_op_string_get +( + GB_Operator op, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + (*value) = '\0' ; + GrB_Type type = NULL ; + const char *name ; + + switch ((int) field) + { + + case GrB_NAME : + + name = GB_op_name_get (op) ; + if (name != NULL) + { + strcpy (value, name) ; + } + #pragma omp flush + return (GrB_SUCCESS) ; + + case GxB_JIT_C_NAME : + + strcpy (value, op->name) ; + #pragma omp flush + return (GrB_SUCCESS) ; + + case GxB_JIT_C_DEFINITION : + + if (op->defn != NULL) + { + strcpy (value, op->defn) ; + } + #pragma omp flush + return (GrB_SUCCESS) ; + + case GrB_INP0_TYPE_STRING : type = op->xtype ; break ; + case GrB_INP1_TYPE_STRING : type = op->ytype ; break ; + case GrB_OUTP_TYPE_STRING : type = op->ztype ; break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + if (type == NULL) + { + // operator does not depend on this input + return (GrB_NO_VALUE) ; + } + + name = GB_type_name_get (type) ; + if (name != NULL) + { + strcpy (value, name) ; + } + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GB_op_string_set.c b/GraphBLAS/Source/GB_op_string_set.c new file mode 100644 index 0000000000..6f49a5fbc5 --- /dev/null +++ b/GraphBLAS/Source/GB_op_string_set.c @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// GB_op_string_set: set the name or defn of an operator +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_op_string_set +( + GB_Operator op, + char * value, + GrB_Field field +) +{ + + GB_Opcode opcode = op->opcode ; + bool user_defined = (opcode == GB_USER_unop_code) || + (opcode == GB_USER_idxunop_code) || + (opcode == GB_USER_binop_code) ; + + bool jitable = + (op->ztype->hash != UINT64_MAX) && + (op->xtype->hash != UINT64_MAX) && + (op->ytype == NULL || op->ytype->hash != UINT64_MAX) ; + + return (GB_op_or_type_string_set (user_defined, jitable, value, field, + &(op->user_name), &(op->user_name_size), + op->name, &(op->name_len), &(op->defn), &(op->defn_size), + &(op->hash))) ; +} + diff --git a/GraphBLAS/Source/GB_ops.c b/GraphBLAS/Source/GB_ops.c index 4f35cd7e87..1d82758af8 100644 --- a/GraphBLAS/Source/GB_ops.c +++ b/GraphBLAS/Source/GB_ops.c @@ -38,6 +38,7 @@ struct GB_Type_opaque GB_OPAQUE (type) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ sizeof (ctype), /* sizeof the type */ \ GB_ ## type ## _code, /* type code */ \ 0, name, /* name_len and name */ \ @@ -69,6 +70,7 @@ GB_TYPEDEF (GxB, FC64 , GxB_FC64_t, "GxB_FC64_t") ; struct GB_Descriptor_opaque GB_OPAQUE (desc_ ## name) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ "", 0, /* logger */ \ (GrB_Desc_Value) (out), \ (GrB_Desc_Value) (mask), \ @@ -140,6 +142,7 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) struct GB_UnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (ztype), /* ztype */ \ & GB_OPAQUE (xtype), /* xtype */ \ NULL, /* ytype */ \ @@ -173,6 +176,7 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) struct GB_BinaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (ztype), /* ztype */ \ & GB_OPAQUE (xtype), \ & GB_OPAQUE (ytype), \ @@ -211,6 +215,7 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) struct GB_UnaryOp_opaque GB_OPAQUE (op ## _ ## type) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (type), /* ztype */ \ & GB_OPAQUE (type), /* xtype */ \ NULL, /* ytype */ \ @@ -226,6 +231,7 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) struct GB_BinaryOp_opaque GB_OPAQUE (op ## _ ## type) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (type), /* ztype */ \ & GB_OPAQUE (type), /* xtype */ \ & GB_OPAQUE (type), /* ytype */ \ @@ -275,6 +281,7 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (GB_XTYPE), /* ztype */ \ NULL, /* xtype */ \ & GB_OPAQUE (GB_XTYPE), /* ytype */ \ @@ -293,6 +300,7 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (GB_XTYPE), /* ztype */ \ NULL, /* xtype */ \ & GB_OPAQUE (GB_XTYPE), /* ytype */ \ @@ -312,6 +320,7 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (BOOL), /* ztype */ \ NULL, /* xtype */ \ & GB_OPAQUE (GB_XTYPE), /* ytype */ \ @@ -329,6 +338,7 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (BOOL), /* ztype */ \ & GB_OPAQUE (GB_XTYPE), /* xtype */ \ & GB_OPAQUE (GB_XTYPE), /* ytype */ \ @@ -346,6 +356,7 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (BOOL), /* ztype */ \ & GB_OPAQUE (GB_XTYPE), /* xtype */ \ & GB_OPAQUE (GB_XTYPE), /* ytype */ \ @@ -364,6 +375,7 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; struct GB_SelectOp_opaque GB_OPAQUE (op) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (BOOL), /* ztype */ \ NULL, /* xtype */ \ NULL, /* thunk type */ \ @@ -488,6 +500,7 @@ GrB_BinaryOp GrB_LXNOR = & GB_OPAQUE (EQ_BOOL) ; struct GB_BinaryOp_opaque GB_OPAQUE (IGNORE_DUP) = { GB_MAGIC2, 0, // magic and header_size + NULL, 0, // no user_name for GrB_get/GrB_set NULL, // ztype NULL, // xtype NULL, // ytype @@ -521,6 +534,7 @@ extern void GB_nonzombie_func (bool *z, const void *x, struct GB_IndexUnaryOp_opaque GB_OPAQUE (NONZOMBIE) = { GB_MAGIC, 0, // magic and header_size + NULL, 0, // no user_name for GrB_get/GrB_set & GB_OPAQUE (BOOL), // ztype NULL, // xtype & GB_OPAQUE (INT64), // ytype @@ -572,6 +586,7 @@ const GxB_Format_Value GxB_FORMAT_DEFAULT = GxB_BY_ROW ; struct GB_Monoid_opaque GB_OPAQUE (GB_EVAL2 (op, _MONOID)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (op), /* additive operator */ \ & GB_OPAQUE (GB_EVAL2 (identity_, op)), /* identity */ \ NULL, /* terminal */ \ @@ -587,6 +602,7 @@ const GxB_Format_Value GxB_FORMAT_DEFAULT = GxB_BY_ROW ; struct GB_Monoid_opaque GB_OPAQUE (GB_EVAL2 (op, _MONOID)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (op), /* additive operator */ \ & GB_OPAQUE (GB_EVAL2 (identity_, op)), /* identity */ \ & GB_OPAQUE (GB_EVAL2 (terminal_, op)), /* terminal */ \ @@ -760,6 +776,7 @@ GB_MONOID_DEF ( BXNOR_UINT64 , uint64_t , 0xFFFFFFFFFFFFFFFF ) struct GB_Semiring_opaque GB_OPAQUE (GB_SEMIRING_NAME(add, mult)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (GB_EVAL4 (add, _, GB_XTYPE, _MONOID)), \ & GB_OPAQUE (GB_EVAL3 (mult, _, GB_XTYPE)), \ NULL, 0, 0, 0 /* name, name_len, name_size, hash */ \ @@ -772,6 +789,7 @@ GB_MONOID_DEF ( BXNOR_UINT64 , uint64_t , 0xFFFFFFFFFFFFFFFF ) struct GB_Semiring_opaque GB_OPAQUE (GB_SEMIRING_NAME(add, mult)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ & GB_OPAQUE (GB_EVAL2 (add, _BOOL_MONOID)), \ & GB_OPAQUE (GB_EVAL3 (mult, _, GB_XTYPE)), \ NULL, 0, 0, 0 /* name, name_len, name_size, hash */ \ @@ -1003,7 +1021,8 @@ struct GB_Context_opaque GB_OPAQUE (CONTEXT_WORLD) = { GB_MAGIC, // magic: initialized 0, // header_size: statically allocated - // revised by GrB_init: + NULL, 0, // no user_name for GrB_get/GrB_set + // revised by GxB_Context_get/set: (double) GB_CHUNK_DEFAULT, // chunk 1, // nthreads_max -1, // gpu_id diff --git a/GraphBLAS/Source/GB_reduce_to_scalar.c b/GraphBLAS/Source/GB_reduce_to_scalar.c index 2a008d1510..838c5c5259 100644 --- a/GraphBLAS/Source/GB_reduce_to_scalar.c +++ b/GraphBLAS/Source/GB_reduce_to_scalar.c @@ -106,7 +106,7 @@ GrB_Info GB_reduce_to_scalar // z = reduce_to_scalar (A) info = GrB_NO_VALUE ; #if defined ( GRAPHBLAS_HAS_CUDA ) - if (GB_reduce_to_scalar_cuda_branch (monoid, A)) + if (GB_cuda_reduce_to_scalar_branch (monoid, A)) { //---------------------------------------------------------------------- @@ -114,7 +114,7 @@ GrB_Info GB_reduce_to_scalar // z = reduce_to_scalar (A) //---------------------------------------------------------------------- GrB_Matrix V = NULL ; - info = GB_reduce_to_scalar_cuda (z, &V, monoid, A) ; + info = GB_cuda_reduce_to_scalar_jit (z, &V, monoid, A) ; if (V != NULL) { @@ -137,11 +137,12 @@ GrB_Info GB_reduce_to_scalar // z = reduce_to_scalar (A) } } - // GB_reduce_to_scalar_cuda may refuse to do the reduction and indicate - // this by returning GrB_NO_VALUE. If so, the CPU will do it below. + // GB_cuda_reduce_to_scalar_jit may refuse to do the reduction and + // indicate this by returning GrB_NO_VALUE. If so, the CPU will do it + // below. if (!(info == GrB_SUCCESS || info == GrB_NO_VALUE)) { - // GB_reduce_to_scalar_cuda has returned an error + // GB_cuda_reduce_to_scalar_jit has returned an error // (out of memory, or other error) return (info) ; } diff --git a/GraphBLAS/Source/GB_semiring_name_get.c b/GraphBLAS/Source/GB_semiring_name_get.c new file mode 100644 index 0000000000..54a6d24843 --- /dev/null +++ b/GraphBLAS/Source/GB_semiring_name_get.c @@ -0,0 +1,3341 @@ +//------------------------------------------------------------------------------ +// GB_semiring_name_get: get the name of a built-in semiring +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +const char *GB_semiring_name_get (GrB_Semiring semiring) +{ + + if (semiring->user_name_size > 0) + { + // user-defined semiring, with name defined by GrB_set + return (semiring->user_name) ; + } + + GB_Opcode add_opcode = semiring->add->op->opcode ; + GB_Opcode mult_opcode = semiring->multiply->opcode ; + GB_Type_code zcode = semiring->add->op->ztype->code ; + GB_Type_code xcode = semiring->multiply->xtype->code ; + bool xbool = (xcode == GB_BOOL_code) ; + + switch (mult_opcode) + { + + //---------------------------------------------------------------------- + case GB_FIRST_binop_code : // z = x + //---------------------------------------------------------------------- + + // 61 semirings with FIRST: + // 50: (min,max,plus,times,any) for 10 non-boolean real + // 5: (or,and,xor,eq,any) for boolean + // 6: (plus,times,any) for 2 complex + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_PLUS_FIRST_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_FIRST_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_FIRST_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_FIRST_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_FIRST_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_FIRST_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_FIRST_UINT32") ; + 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 GB_FC32_code : return ("GxB_PLUS_FIRST_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_FIRST_FC64" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_TIMES_FIRST_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_FIRST_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_FIRST_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_FIRST_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_FIRST_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_FIRST_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_FIRST_UINT32") ; + 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 GB_FC32_code : return ("GxB_TIMES_FIRST_FC32" ) ; + case GB_FC64_code : return ("GxB_TIMES_FIRST_FC64" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 11 real and boolean types, plus 2 complex + case GB_BOOL_code : return ("GxB_ANY_FIRST_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_FIRST_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_FIRST_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_FIRST_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_FIRST_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_FIRST_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_FIRST_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_FIRST_UINT32") ; + 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 GB_FC32_code : return ("GxB_ANY_FIRST_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_FIRST_FC64" ) ; + default: ; + } + break ; + + case GB_LOR_binop_code : if (xbool) return ("GxB_LOR_FIRST_BOOL" ) ; + case GB_LAND_binop_code : if (xbool) return ("GxB_LAND_FIRST_BOOL" ) ; + case GB_EQ_binop_code : if (xbool) return ("GxB_EQ_FIRST_BOOL" ) ; + case GB_LXOR_binop_code : if (xbool) return ("GxB_LXOR_FIRST_BOOL") ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_SECOND_binop_code : // z = y + //---------------------------------------------------------------------- + + // 61 semirings with SECOND: + // 50: (min,max,plus,times,any) for 10 real non-boolean + // 5: (or,and,xor,eq,any) for boolean + // 6: (plus,times,any) for 2 complex + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_PLUS_SECOND_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_SECOND_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_SECOND_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_SECOND_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_SECOND_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_SECOND_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_SECOND_UINT32") ; + 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 GB_FC32_code : return ("GxB_PLUS_SECOND_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_SECOND_FC64" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_TIMES_SECOND_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_SECOND_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_SECOND_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_SECOND_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_SECOND_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_SECOND_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_SECOND_UINT32") ; + 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 GB_FC32_code : return ("GxB_TIMES_SECOND_FC32" ) ; + case GB_FC64_code : return ("GxB_TIMES_SECOND_FC64" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 11 real and boolean types, plus 2 complex + case GB_BOOL_code : return ("GxB_ANY_SECOND_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_SECOND_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_SECOND_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_SECOND_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_SECOND_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_SECOND_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_SECOND_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_SECOND_UINT32") ; + 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 GB_FC32_code : return ("GxB_ANY_SECOND_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_SECOND_FC64" ) ; + default: ; + } + break ; + + case GB_LOR_binop_code : if (xbool) return ("GxB_LOR_SECOND_BOOL" ) ; + case GB_LAND_binop_code : if (xbool) return ("GxB_LAND_SECOND_BOOL" ) ; + case GB_EQ_binop_code : if (xbool) return ("GxB_EQ_SECOND_BOOL" ) ; + case GB_LXOR_binop_code : if (xbool) return ("GxB_LXOR_SECOND_BOOL") ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_MIN_binop_code : // z = min(x,y) + //---------------------------------------------------------------------- + + // 50 semirings: (min,max,plus,times,any) for 10 real non-boolean + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_MIN_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_MIN_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_MIN_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_MIN_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_MIN_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_MIN_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_MIN_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_MIN_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_MIN_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_MIN_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_MIN_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_MIN_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_MIN_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_MIN_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_ANY_MIN_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_MIN_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_MIN_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_MIN_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_MIN_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_MIN_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_MIN_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_MAX_binop_code : // z = max(x,y) + //---------------------------------------------------------------------- + + // 50 semirings: (min,max,plus,times,any) for 10 real non-boolean + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_MAX_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_MAX_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_MAX_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_MAX_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_MAX_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_MAX_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_MAX_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_MAX_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_MAX_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_MAX_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_MAX_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_MAX_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_MAX_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_MAX_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_MAX_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_MAX_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_MAX_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_MAX_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_MAX_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_MAX_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_MAX_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_ANY_MAX_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_MAX_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_MAX_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_MAX_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_MAX_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_MAX_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_MAX_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_PLUS_binop_code : // z = x + y + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_PLUS_PLUS_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_PLUS_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_PLUS_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_PLUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_PLUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_PLUS_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_PLUS_UINT32") ; + 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 GB_FC32_code : return ("GxB_PLUS_PLUS_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_PLUS_FC64" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_TIMES_PLUS_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_PLUS_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_PLUS_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_PLUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_PLUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_PLUS_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_PLUS_UINT32") ; + 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 GB_FC32_code : return ("GxB_TIMES_PLUS_FC32" ) ; + case GB_FC64_code : return ("GxB_TIMES_PLUS_FC64" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_ANY_PLUS_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_PLUS_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_PLUS_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_PLUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_PLUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_PLUS_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_PLUS_UINT32") ; + 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 GB_FC32_code : return ("GxB_ANY_PLUS_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_PLUS_FC64" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_MINUS_binop_code : // z = x - y + //---------------------------------------------------------------------- + + // 56 semirings: + // 50 semirings: (min,max,plus,times,any) for 10 real non-boolean + // 6: (plus,times,any) for 2 complex types + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_MINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_MINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_MINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_MINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_MINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_MINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_MINUS_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_MINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_MINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_MINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_MINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_MINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_MINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_MINUS_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_PLUS_MINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_MINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_MINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_MINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_MINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_MINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_MINUS_UINT32") ; + 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 GB_FC32_code : return ("GxB_PLUS_MINUS_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_MINUS_FC64" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_TIMES_MINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_MINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_MINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_MINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_MINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_MINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_MINUS_UINT32") ; + 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 GB_FC32_code : return ("GxB_TIMES_MINUS_FC32" ) ; + case GB_FC64_code : return ("GxB_TIMES_MINUS_FC64" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_ANY_MINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_MINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_MINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_MINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_MINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_MINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_MINUS_UINT32") ; + 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 GB_FC32_code : return ("GxB_ANY_MINUS_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_MINUS_FC64" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_ISEQ_binop_code : // z = (x == y) + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_ISEQ_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_ISEQ_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_ISEQ_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_ISEQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_ISEQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_ISEQ_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_ISEQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_ISEQ_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_ISEQ_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_ISEQ_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_ISEQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_ISEQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_ISEQ_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_ISEQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_ISEQ_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_ISEQ_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_ISEQ_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_ISEQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_ISEQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_ISEQ_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_ISEQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_ISEQ_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_ISEQ_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_ISEQ_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_ISEQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_ISEQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_ISEQ_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_ISEQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_ANY_ISEQ_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_ISEQ_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_ISEQ_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_ISEQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_ISEQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_ISEQ_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_ISEQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_ISNE_binop_code : // z = (x == y) + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_ISNE_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_ISNE_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_ISNE_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_ISNE_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_ISNE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_ISNE_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_ISNE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_ISNE_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_ISNE_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_ISNE_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_ISNE_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_ISNE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_ISNE_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_ISNE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_ISNE_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_ISNE_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_ISNE_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_ISNE_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_ISNE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_ISNE_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_ISNE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_ISNE_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_ISNE_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_ISNE_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_ISNE_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_ISNE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_ISNE_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_ISNE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_ANY_ISNE_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_ISNE_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_ISNE_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_ISNE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_ISNE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_ISNE_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_ISNE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_ISGT_binop_code : // z = (x == y) + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_ISGT_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_ISGT_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_ISGT_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_ISGT_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_ISGT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_ISGT_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_ISGT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_ISGT_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_ISGT_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_ISGT_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_ISGT_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_ISGT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_ISGT_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_ISGT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_ISGT_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_ISGT_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_ISGT_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_ISGT_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_ISGT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_ISGT_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_ISGT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_ISGT_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_ISGT_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_ISGT_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_ISGT_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_ISGT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_ISGT_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_ISGT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_ANY_ISGT_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_ISGT_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_ISGT_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_ISGT_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_ISGT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_ISGT_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_ISGT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_ISLT_binop_code : // z = (x == y) + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_ISLT_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_ISLT_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_ISLT_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_ISLT_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_ISLT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_ISLT_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_ISLT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_ISLT_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_ISLT_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_ISLT_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_ISLT_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_ISLT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_ISLT_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_ISLT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_ISLT_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_ISLT_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_ISLT_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_ISLT_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_ISLT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_ISLT_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_ISLT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_ISLT_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_ISLT_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_ISLT_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_ISLT_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_ISLT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_ISLT_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_ISLT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_ANY_ISLT_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_ISLT_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_ISLT_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_ISLT_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_ISLT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_ISLT_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_ISLT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_ISGE_binop_code : // z = (x == y) + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_ISGE_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_ISGE_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_ISGE_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_ISGE_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_ISGE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_ISGE_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_ISGE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_ISGE_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_ISGE_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_ISGE_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_ISGE_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_ISGE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_ISGE_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_ISGE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_ISGE_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_ISGE_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_ISGE_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_ISGE_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_ISGE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_ISGE_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_ISGE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_ISGE_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_ISGE_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_ISGE_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_ISGE_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_ISGE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_ISGE_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_ISGE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_ANY_ISGE_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_ISGE_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_ISGE_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_ISGE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_ISGE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_ISGE_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_ISGE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_ISLE_binop_code : // z = (x == y) + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_ISLE_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_ISLE_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_ISLE_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_ISLE_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_ISLE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_ISLE_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_ISLE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_ISLE_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_ISLE_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_ISLE_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_ISLE_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_ISLE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_ISLE_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_ISLE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_ISLE_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_ISLE_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_ISLE_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_ISLE_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_ISLE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_ISLE_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_ISLE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_ISLE_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_ISLE_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_ISLE_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_ISLE_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_ISLE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_ISLE_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_ISLE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_ANY_ISLE_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_ISLE_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_ISLE_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_ISLE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_ISLE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_ISLE_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_ISLE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_RMINUS_binop_code : // z = y - x (reverse minus) + //---------------------------------------------------------------------- + + // 56 semirings: + // 50 semirings: (min,max,plus,times,any) for 10 real non-boolean + // 6: (plus,times,any) for 2 complex types + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_RMINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_RMINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_RMINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_RMINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_RMINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_RMINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_RMINUS_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_RMINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_RMINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_RMINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_RMINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_RMINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_RMINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_RMINUS_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_PLUS_RMINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_RMINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_RMINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_RMINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_RMINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_RMINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_RMINUS_UINT32") ; + 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 GB_FC32_code : return ("GxB_PLUS_RMINUS_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_RMINUS_FC64" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_TIMES_RMINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_RMINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_RMINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_RMINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_RMINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_RMINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_RMINUS_UINT32") ; + 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 GB_FC32_code : return ("GxB_TIMES_RMINUS_FC32" ) ; + case GB_FC64_code : return ("GxB_TIMES_RMINUS_FC64" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_ANY_RMINUS_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_RMINUS_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_RMINUS_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_RMINUS_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_RMINUS_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_RMINUS_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_RMINUS_UINT32") ; + 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 GB_FC32_code : return ("GxB_ANY_RMINUS_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_RMINUS_FC64" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_TIMES_binop_code : // z = x * y + //---------------------------------------------------------------------- + + // 56 semirings: + // 50 semirings: (min,max,plus,times,any) for 10 real non-boolean + // 6: (plus,times,any) for 2 complex types + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + 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 GB_FC32_code : return ("GxB_PLUS_TIMES_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_TIMES_FC64" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_TIMES_TIMES_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_TIMES_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_TIMES_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_TIMES_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_TIMES_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_TIMES_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_TIMES_UINT32") ; + 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 GB_FC32_code : return ("GxB_TIMES_TIMES_FC32" ) ; + case GB_FC64_code : return ("GxB_TIMES_TIMES_FC64" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_ANY_TIMES_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_TIMES_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_TIMES_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_TIMES_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_TIMES_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_TIMES_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_TIMES_UINT32") ; + 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 GB_FC32_code : return ("GxB_ANY_TIMES_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_TIMES_FC64" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_DIV_binop_code : // z = x / y + //---------------------------------------------------------------------- + + // 56 semirings: + // 50 semirings: (min,max,plus,times,any) for 10 real non-boolean + // 6: (plus,times,any) for 2 complex types + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_DIV_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_DIV_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_DIV_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_DIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_DIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_DIV_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_DIV_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_DIV_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_DIV_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_DIV_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_DIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_DIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_DIV_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_DIV_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_PLUS_DIV_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_DIV_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_DIV_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_DIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_DIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_DIV_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_DIV_UINT32") ; + 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 GB_FC32_code : return ("GxB_PLUS_DIV_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_DIV_FC64" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_TIMES_DIV_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_DIV_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_DIV_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_DIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_DIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_DIV_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_DIV_UINT32") ; + 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 GB_FC32_code : return ("GxB_TIMES_DIV_FC32" ) ; + case GB_FC64_code : return ("GxB_TIMES_DIV_FC64" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_ANY_DIV_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_DIV_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_DIV_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_DIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_DIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_DIV_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_DIV_UINT32") ; + 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 GB_FC32_code : return ("GxB_ANY_DIV_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_DIV_FC64" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_RDIV_binop_code : // z = y / x (reverse division) + //---------------------------------------------------------------------- + + // 56 semirings: + // 50 semirings: (min,max,plus,times,any) for 10 real non-boolean + // 6: (plus,times,any) for 2 complex types + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_RDIV_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_RDIV_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_RDIV_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_RDIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_RDIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_RDIV_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_RDIV_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_RDIV_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_RDIV_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_RDIV_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_RDIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_RDIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_RDIV_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_RDIV_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_PLUS_RDIV_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_RDIV_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_RDIV_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_RDIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_RDIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_RDIV_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_RDIV_UINT32") ; + 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 GB_FC32_code : return ("GxB_PLUS_RDIV_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_RDIV_FC64" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_TIMES_RDIV_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_RDIV_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_RDIV_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_RDIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_RDIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_RDIV_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_RDIV_UINT32") ; + 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 GB_FC32_code : return ("GxB_TIMES_RDIV_FC32" ) ; + case GB_FC64_code : return ("GxB_TIMES_RDIV_FC64" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_ANY_RDIV_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_RDIV_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_RDIV_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_RDIV_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_RDIV_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_RDIV_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_RDIV_UINT32") ; + 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 GB_FC32_code : return ("GxB_ANY_RDIV_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_RDIV_FC64" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_EQ_binop_code : // z = (x == y) + //---------------------------------------------------------------------- + + // 55 semirings: (and,or,xor,eq,any) * 11 types (all but complex) + + switch (add_opcode) + { + + case GB_LOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LOR_EQ_BOOL" ) ; + case GB_INT8_code : return ("GxB_LOR_EQ_INT8" ) ; + case GB_INT16_code : return ("GxB_LOR_EQ_INT16" ) ; + case GB_INT32_code : return ("GxB_LOR_EQ_INT32" ) ; + case GB_INT64_code : return ("GxB_LOR_EQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_LOR_EQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LOR_EQ_UINT16") ; + case GB_UINT32_code : return ("GxB_LOR_EQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LAND_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LAND_EQ_BOOL" ) ; + case GB_INT8_code : return ("GxB_LAND_EQ_INT8" ) ; + case GB_INT16_code : return ("GxB_LAND_EQ_INT16" ) ; + case GB_INT32_code : return ("GxB_LAND_EQ_INT32" ) ; + case GB_INT64_code : return ("GxB_LAND_EQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_LAND_EQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LAND_EQ_UINT16") ; + case GB_UINT32_code : return ("GxB_LAND_EQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LXOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LXOR_EQ_BOOL" ) ; + case GB_INT8_code : return ("GxB_LXOR_EQ_INT8" ) ; + case GB_INT16_code : return ("GxB_LXOR_EQ_INT16" ) ; + case GB_INT32_code : return ("GxB_LXOR_EQ_INT32" ) ; + case GB_INT64_code : return ("GxB_LXOR_EQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_LXOR_EQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LXOR_EQ_UINT16") ; + case GB_UINT32_code : return ("GxB_LXOR_EQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_EQ_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_EQ_EQ_BOOL" ) ; + case GB_INT8_code : return ("GxB_EQ_EQ_INT8" ) ; + case GB_INT16_code : return ("GxB_EQ_EQ_INT16" ) ; + case GB_INT32_code : return ("GxB_EQ_EQ_INT32" ) ; + case GB_INT64_code : return ("GxB_EQ_EQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_EQ_EQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_EQ_EQ_UINT16") ; + case GB_UINT32_code : return ("GxB_EQ_EQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_ANY_EQ_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_EQ_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_EQ_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_EQ_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_EQ_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_EQ_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_EQ_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_EQ_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_NE_binop_code : // z = (x != y) + //---------------------------------------------------------------------- + + // 50 semirings: (and,or,xor,eq,any) * (10 real non-boolean types) + + switch (add_opcode) + { + + case GB_LOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_LOR_NE_INT8" ) ; + case GB_INT16_code : return ("GxB_LOR_NE_INT16" ) ; + case GB_INT32_code : return ("GxB_LOR_NE_INT32" ) ; + case GB_INT64_code : return ("GxB_LOR_NE_INT64" ) ; + case GB_UINT8_code : return ("GxB_LOR_NE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LOR_NE_UINT16") ; + case GB_UINT32_code : return ("GxB_LOR_NE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LAND_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_LAND_NE_INT8" ) ; + case GB_INT16_code : return ("GxB_LAND_NE_INT16" ) ; + case GB_INT32_code : return ("GxB_LAND_NE_INT32" ) ; + case GB_INT64_code : return ("GxB_LAND_NE_INT64" ) ; + case GB_UINT8_code : return ("GxB_LAND_NE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LAND_NE_UINT16") ; + case GB_UINT32_code : return ("GxB_LAND_NE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LXOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_LXOR_NE_INT8" ) ; + case GB_INT16_code : return ("GxB_LXOR_NE_INT16" ) ; + case GB_INT32_code : return ("GxB_LXOR_NE_INT32" ) ; + case GB_INT64_code : return ("GxB_LXOR_NE_INT64" ) ; + case GB_UINT8_code : return ("GxB_LXOR_NE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LXOR_NE_UINT16") ; + case GB_UINT32_code : return ("GxB_LXOR_NE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_EQ_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_EQ_NE_INT8" ) ; + case GB_INT16_code : return ("GxB_EQ_NE_INT16" ) ; + case GB_INT32_code : return ("GxB_EQ_NE_INT32" ) ; + case GB_INT64_code : return ("GxB_EQ_NE_INT64" ) ; + case GB_UINT8_code : return ("GxB_EQ_NE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_EQ_NE_UINT16") ; + case GB_UINT32_code : return ("GxB_EQ_NE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_ANY_NE_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_NE_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_NE_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_NE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_NE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_NE_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_NE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_GT_binop_code : // z = (x > y) + //---------------------------------------------------------------------- + + // 55 semirings: (and,or,xor,eq,any) * 11 types (all but complex) + + switch (add_opcode) + { + + case GB_LOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LOR_GT_BOOL" ) ; + case GB_INT8_code : return ("GxB_LOR_GT_INT8" ) ; + case GB_INT16_code : return ("GxB_LOR_GT_INT16" ) ; + case GB_INT32_code : return ("GxB_LOR_GT_INT32" ) ; + case GB_INT64_code : return ("GxB_LOR_GT_INT64" ) ; + case GB_UINT8_code : return ("GxB_LOR_GT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LOR_GT_UINT16") ; + case GB_UINT32_code : return ("GxB_LOR_GT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LAND_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LAND_GT_BOOL" ) ; + case GB_INT8_code : return ("GxB_LAND_GT_INT8" ) ; + case GB_INT16_code : return ("GxB_LAND_GT_INT16" ) ; + case GB_INT32_code : return ("GxB_LAND_GT_INT32" ) ; + case GB_INT64_code : return ("GxB_LAND_GT_INT64" ) ; + case GB_UINT8_code : return ("GxB_LAND_GT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LAND_GT_UINT16") ; + case GB_UINT32_code : return ("GxB_LAND_GT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LXOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LXOR_GT_BOOL" ) ; + case GB_INT8_code : return ("GxB_LXOR_GT_INT8" ) ; + case GB_INT16_code : return ("GxB_LXOR_GT_INT16" ) ; + case GB_INT32_code : return ("GxB_LXOR_GT_INT32" ) ; + case GB_INT64_code : return ("GxB_LXOR_GT_INT64" ) ; + case GB_UINT8_code : return ("GxB_LXOR_GT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LXOR_GT_UINT16") ; + case GB_UINT32_code : return ("GxB_LXOR_GT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_EQ_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_EQ_GT_BOOL" ) ; + case GB_INT8_code : return ("GxB_EQ_GT_INT8" ) ; + case GB_INT16_code : return ("GxB_EQ_GT_INT16" ) ; + case GB_INT32_code : return ("GxB_EQ_GT_INT32" ) ; + case GB_INT64_code : return ("GxB_EQ_GT_INT64" ) ; + case GB_UINT8_code : return ("GxB_EQ_GT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_EQ_GT_UINT16") ; + case GB_UINT32_code : return ("GxB_EQ_GT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_ANY_GT_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_GT_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_GT_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_GT_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_GT_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_GT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_GT_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_GT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_LT_binop_code : // z = (x < y) + //---------------------------------------------------------------------- + + // 55 semirings: (and,or,xor,eq,any) * 11 types (all but complex) + + switch (add_opcode) + { + + case GB_LOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LOR_LT_BOOL" ) ; + case GB_INT8_code : return ("GxB_LOR_LT_INT8" ) ; + case GB_INT16_code : return ("GxB_LOR_LT_INT16" ) ; + case GB_INT32_code : return ("GxB_LOR_LT_INT32" ) ; + case GB_INT64_code : return ("GxB_LOR_LT_INT64" ) ; + case GB_UINT8_code : return ("GxB_LOR_LT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LOR_LT_UINT16") ; + case GB_UINT32_code : return ("GxB_LOR_LT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LAND_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LAND_LT_BOOL" ) ; + case GB_INT8_code : return ("GxB_LAND_LT_INT8" ) ; + case GB_INT16_code : return ("GxB_LAND_LT_INT16" ) ; + case GB_INT32_code : return ("GxB_LAND_LT_INT32" ) ; + case GB_INT64_code : return ("GxB_LAND_LT_INT64" ) ; + case GB_UINT8_code : return ("GxB_LAND_LT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LAND_LT_UINT16") ; + case GB_UINT32_code : return ("GxB_LAND_LT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LXOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LXOR_LT_BOOL" ) ; + case GB_INT8_code : return ("GxB_LXOR_LT_INT8" ) ; + case GB_INT16_code : return ("GxB_LXOR_LT_INT16" ) ; + case GB_INT32_code : return ("GxB_LXOR_LT_INT32" ) ; + case GB_INT64_code : return ("GxB_LXOR_LT_INT64" ) ; + case GB_UINT8_code : return ("GxB_LXOR_LT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LXOR_LT_UINT16") ; + case GB_UINT32_code : return ("GxB_LXOR_LT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_EQ_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_EQ_LT_BOOL" ) ; + case GB_INT8_code : return ("GxB_EQ_LT_INT8" ) ; + case GB_INT16_code : return ("GxB_EQ_LT_INT16" ) ; + case GB_INT32_code : return ("GxB_EQ_LT_INT32" ) ; + case GB_INT64_code : return ("GxB_EQ_LT_INT64" ) ; + case GB_UINT8_code : return ("GxB_EQ_LT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_EQ_LT_UINT16") ; + case GB_UINT32_code : return ("GxB_EQ_LT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_ANY_LT_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_LT_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_LT_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_LT_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_LT_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_LT_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_LT_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_LT_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_GE_binop_code : // z = (x >= y) + //---------------------------------------------------------------------- + + // 55 semirings: (and,or,xor,eq,any) * 11 types (all but complex) + + switch (add_opcode) + { + + case GB_LOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LOR_GE_BOOL" ) ; + case GB_INT8_code : return ("GxB_LOR_GE_INT8" ) ; + case GB_INT16_code : return ("GxB_LOR_GE_INT16" ) ; + case GB_INT32_code : return ("GxB_LOR_GE_INT32" ) ; + case GB_INT64_code : return ("GxB_LOR_GE_INT64" ) ; + case GB_UINT8_code : return ("GxB_LOR_GE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LOR_GE_UINT16") ; + case GB_UINT32_code : return ("GxB_LOR_GE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LAND_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LAND_GE_BOOL" ) ; + case GB_INT8_code : return ("GxB_LAND_GE_INT8" ) ; + case GB_INT16_code : return ("GxB_LAND_GE_INT16" ) ; + case GB_INT32_code : return ("GxB_LAND_GE_INT32" ) ; + case GB_INT64_code : return ("GxB_LAND_GE_INT64" ) ; + case GB_UINT8_code : return ("GxB_LAND_GE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LAND_GE_UINT16") ; + case GB_UINT32_code : return ("GxB_LAND_GE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LXOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LXOR_GE_BOOL" ) ; + case GB_INT8_code : return ("GxB_LXOR_GE_INT8" ) ; + case GB_INT16_code : return ("GxB_LXOR_GE_INT16" ) ; + case GB_INT32_code : return ("GxB_LXOR_GE_INT32" ) ; + case GB_INT64_code : return ("GxB_LXOR_GE_INT64" ) ; + case GB_UINT8_code : return ("GxB_LXOR_GE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LXOR_GE_UINT16") ; + case GB_UINT32_code : return ("GxB_LXOR_GE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_EQ_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_EQ_GE_BOOL" ) ; + case GB_INT8_code : return ("GxB_EQ_GE_INT8" ) ; + case GB_INT16_code : return ("GxB_EQ_GE_INT16" ) ; + case GB_INT32_code : return ("GxB_EQ_GE_INT32" ) ; + case GB_INT64_code : return ("GxB_EQ_GE_INT64" ) ; + case GB_UINT8_code : return ("GxB_EQ_GE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_EQ_GE_UINT16") ; + case GB_UINT32_code : return ("GxB_EQ_GE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_ANY_GE_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_GE_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_GE_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_GE_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_GE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_GE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_GE_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_GE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_LE_binop_code : // z = (x <= y) + //---------------------------------------------------------------------- + + // 55 semirings: (and,or,xor,eq,any) * 11 types (all but complex) + + switch (add_opcode) + { + + case GB_LOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LOR_LE_BOOL" ) ; + case GB_INT8_code : return ("GxB_LOR_LE_INT8" ) ; + case GB_INT16_code : return ("GxB_LOR_LE_INT16" ) ; + case GB_INT32_code : return ("GxB_LOR_LE_INT32" ) ; + case GB_INT64_code : return ("GxB_LOR_LE_INT64" ) ; + case GB_UINT8_code : return ("GxB_LOR_LE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LOR_LE_UINT16") ; + case GB_UINT32_code : return ("GxB_LOR_LE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LAND_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LAND_LE_BOOL" ) ; + case GB_INT8_code : return ("GxB_LAND_LE_INT8" ) ; + case GB_INT16_code : return ("GxB_LAND_LE_INT16" ) ; + case GB_INT32_code : return ("GxB_LAND_LE_INT32" ) ; + case GB_INT64_code : return ("GxB_LAND_LE_INT64" ) ; + case GB_UINT8_code : return ("GxB_LAND_LE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LAND_LE_UINT16") ; + case GB_UINT32_code : return ("GxB_LAND_LE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LXOR_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_LXOR_LE_BOOL" ) ; + case GB_INT8_code : return ("GxB_LXOR_LE_INT8" ) ; + case GB_INT16_code : return ("GxB_LXOR_LE_INT16" ) ; + case GB_INT32_code : return ("GxB_LXOR_LE_INT32" ) ; + case GB_INT64_code : return ("GxB_LXOR_LE_INT64" ) ; + case GB_UINT8_code : return ("GxB_LXOR_LE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_LXOR_LE_UINT16") ; + case GB_UINT32_code : return ("GxB_LXOR_LE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_EQ_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_EQ_LE_BOOL" ) ; + case GB_INT8_code : return ("GxB_EQ_LE_INT8" ) ; + case GB_INT16_code : return ("GxB_EQ_LE_INT16" ) ; + case GB_INT32_code : return ("GxB_EQ_LE_INT32" ) ; + case GB_INT64_code : return ("GxB_EQ_LE_INT64" ) ; + case GB_UINT8_code : return ("GxB_EQ_LE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_EQ_LE_UINT16") ; + case GB_UINT32_code : return ("GxB_EQ_LE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus boolean + case GB_BOOL_code : return ("GxB_ANY_LE_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_LE_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_LE_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_LE_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_LE_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_LE_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_LE_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_LE_UINT32") ; + 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" ) ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_PAIR_binop_code : // z = 1 + //---------------------------------------------------------------------- + + // 26 semirings with PAIR: + // 13: ANY_PAIR semirings + // 12: (plus) for 10 real non-boolean and 2 complex + // 1: (xor) for boolean + + switch (add_opcode) + { + + case GB_MIN_binop_code: + case GB_MAX_binop_code: + case GB_TIMES_binop_code: + case GB_LOR_binop_code: + case GB_LAND_binop_code: + case GB_EQ_binop_code: + case GB_ANY_binop_code: + + switch (xcode) + { + // 11 real and boolean types, plus 2 complex + case GB_BOOL_code : return ("GxB_ANY_PAIR_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_PAIR_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_PAIR_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_PAIR_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_PAIR_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_PAIR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_PAIR_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_PAIR_UINT32") ; + 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 GB_FC32_code : return ("GxB_ANY_PAIR_FC32" ) ; + case GB_FC64_code : return ("GxB_ANY_PAIR_FC64" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types, plus 2 complex + case GB_INT8_code : return ("GxB_PLUS_PAIR_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_PAIR_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_PAIR_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_PAIR_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_PAIR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_PAIR_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_PAIR_UINT32") ; + 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 GB_FC32_code : return ("GxB_PLUS_PAIR_FC32" ) ; + case GB_FC64_code : return ("GxB_PLUS_PAIR_FC64" ) ; + default: ; + } + break ; + + case GB_LXOR_binop_code : if (xbool) return ("GxB_LXOR_PAIR_BOOL") ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_LOR_binop_code : // z = x || y + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_LOR_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_LOR_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_LOR_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_LOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_LOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_LOR_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_LOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_LOR_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_LOR_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_LOR_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_LOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_LOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_LOR_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_LOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_LOR_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_LOR_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_LOR_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_LOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_LOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_LOR_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_LOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_LOR_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_LOR_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_LOR_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_LOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_LOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_LOR_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_LOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 11 real and boolean types + case GB_BOOL_code : return ("GxB_ANY_LOR_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_LOR_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_LOR_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_LOR_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_LOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_LOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_LOR_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_LOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LOR_binop_code : if (xbool) return ("GxB_LOR_LOR_BOOL" ) ; + case GB_LAND_binop_code : if (xbool) return ("GrB_LAND_LOR_SEMIRING_BOOL" ) ; + case GB_EQ_binop_code : if (xbool) return ("GrB_LXNOR_LOR_SEMIRING_BOOL") ; + case GB_LXOR_binop_code : if (xbool) return ("GxB_LXOR_LOR_BOOL" ) ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_LAND_binop_code : // z = x && y + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_LAND_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_LAND_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_LAND_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_LAND_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_LAND_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_LAND_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_LAND_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_LAND_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_LAND_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_LAND_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_LAND_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_LAND_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_LAND_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_LAND_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_LAND_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_LAND_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_LAND_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_LAND_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_LAND_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_LAND_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_LAND_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_LAND_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_LAND_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_LAND_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_LAND_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_LAND_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_LAND_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_LAND_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 11 real and boolean types + case GB_BOOL_code : return ("GxB_ANY_LAND_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_LAND_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_LAND_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_LAND_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_LAND_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_LAND_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_LAND_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_LAND_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LOR_binop_code : if (xbool) return ("GrB_LOR_LAND_SEMIRING_BOOL" ) ; + case GB_LAND_binop_code : if (xbool) return ("GxB_LAND_LAND_BOOL" ) ; + case GB_EQ_binop_code : if (xbool) return ("GxB_EQ_LAND_BOOL" ) ; + case GB_LXOR_binop_code : if (xbool) return ("GrB_LXOR_LAND_SEMIRING_BOOL") ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_LXOR_binop_code : // z = x != y + //---------------------------------------------------------------------- + + switch (add_opcode) + { + + case GB_MIN_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MIN_LXOR_INT8" ) ; + case GB_INT16_code : return ("GxB_MIN_LXOR_INT16" ) ; + case GB_INT32_code : return ("GxB_MIN_LXOR_INT32" ) ; + case GB_INT64_code : return ("GxB_MIN_LXOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_MIN_LXOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MIN_LXOR_UINT16") ; + case GB_UINT32_code : return ("GxB_MIN_LXOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_MAX_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_MAX_LXOR_INT8" ) ; + case GB_INT16_code : return ("GxB_MAX_LXOR_INT16" ) ; + case GB_INT32_code : return ("GxB_MAX_LXOR_INT32" ) ; + case GB_INT64_code : return ("GxB_MAX_LXOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_MAX_LXOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_MAX_LXOR_UINT16") ; + case GB_UINT32_code : return ("GxB_MAX_LXOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_PLUS_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_PLUS_LXOR_INT8" ) ; + case GB_INT16_code : return ("GxB_PLUS_LXOR_INT16" ) ; + case GB_INT32_code : return ("GxB_PLUS_LXOR_INT32" ) ; + case GB_INT64_code : return ("GxB_PLUS_LXOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_PLUS_LXOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_PLUS_LXOR_UINT16") ; + case GB_UINT32_code : return ("GxB_PLUS_LXOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_TIMES_binop_code: + + switch (xcode) + { + // 10 real, non-boolean types + case GB_INT8_code : return ("GxB_TIMES_LXOR_INT8" ) ; + case GB_INT16_code : return ("GxB_TIMES_LXOR_INT16" ) ; + case GB_INT32_code : return ("GxB_TIMES_LXOR_INT32" ) ; + case GB_INT64_code : return ("GxB_TIMES_LXOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_TIMES_LXOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_TIMES_LXOR_UINT16") ; + case GB_UINT32_code : return ("GxB_TIMES_LXOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_ANY_binop_code: + + switch (xcode) + { + // 11 real and boolean types + case GB_BOOL_code : return ("GxB_ANY_LXOR_BOOL" ) ; + case GB_INT8_code : return ("GxB_ANY_LXOR_INT8" ) ; + case GB_INT16_code : return ("GxB_ANY_LXOR_INT16" ) ; + case GB_INT32_code : return ("GxB_ANY_LXOR_INT32" ) ; + case GB_INT64_code : return ("GxB_ANY_LXOR_INT64" ) ; + case GB_UINT8_code : return ("GxB_ANY_LXOR_UINT8" ) ; + case GB_UINT16_code : return ("GxB_ANY_LXOR_UINT16") ; + case GB_UINT32_code : return ("GxB_ANY_LXOR_UINT32") ; + 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" ) ; + default: ; + } + break ; + + case GB_LOR_binop_code : if (xbool) return ("GxB_LOR_LXOR_BOOL" ) ; + case GB_LAND_binop_code : if (xbool) return ("GxB_LAND_LXOR_BOOL" ) ; + case GB_EQ_binop_code : if (xbool) return ("GxB_EQ_LXOR_BOOL" ) ; + case GB_LXOR_binop_code : if (xbool) return ("GxB_LXOR_LXOR_BOOL" ) ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_BOR_binop_code : // z = (x | y), bitwise or + //---------------------------------------------------------------------- + + // 16 semirings: (bor,band,bxor,bxnor) * (uint8,16,32,64) + + switch (add_opcode) + { + + case GB_BOR_binop_code : // z = (x | y), bitwise or + + 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") ; + default: ; + } + break ; + + case GB_BAND_binop_code : // z = (x & y), bitwise and + + 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") ; + default: ; + } + break ; + + case GB_BXOR_binop_code : // z = (x ^ y), bitwise xor + + 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") ; + default: ; + } + break ; + + case GB_BXNOR_binop_code : // z = ~(x ^ y), bitwise xnor + + 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") ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_BAND_binop_code : // z = (x & y), bitwise and + //---------------------------------------------------------------------- + + // 16 semirings: (bor,band,bxor,bxnor) * (uint8,16,32,64) + + switch (add_opcode) + { + + case GB_BOR_binop_code : // z = (x | y), bitwise or + + 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") ; + default: ; + } + break ; + + case GB_BAND_binop_code : // z = (x & y), bitwise and + + 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") ; + default: ; + } + break ; + + case GB_BXOR_binop_code : // z = (x ^ y), bitwise xor + + 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") ; + default: ; + } + break ; + + case GB_BXNOR_binop_code : // z = ~(x ^ y), bitwise xnor + + 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") ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_BXOR_binop_code : // z = (x ^ y), bitwise xor + //---------------------------------------------------------------------- + + // 16 semirings: (bor,band,bxor,bxnor) * (uint8,16,32,64) + + switch (add_opcode) + { + + case GB_BOR_binop_code : // z = (x | y), bitwise or + + 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") ; + default: ; + } + break ; + + case GB_BAND_binop_code : // z = (x & y), bitwise and + + 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") ; + default: ; + } + break ; + + case GB_BXOR_binop_code : // z = (x ^ y), bitwise xor + + 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") ; + default: ; + } + break ; + + case GB_BXNOR_binop_code : // z = ~(x ^ y), bitwise xnor + + 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") ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_BXNOR_binop_code : // z = ~(x ^ y), bitwise xnor + //---------------------------------------------------------------------- + + // 16 semirings: (bor,band,bxor,bxnor) * (uint8,16,32,64) + + switch (add_opcode) + { + + case GB_BOR_binop_code : // z = (x | y), bitwise or + + 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") ; + default: ; + } + break ; + + case GB_BAND_binop_code : // z = (x & y), bitwise and + + 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") ; + default: ; + } + break ; + + case GB_BXOR_binop_code : // z = (x ^ y), bitwise xor + + 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") ; + default: ; + } + break ; + + case GB_BXNOR_binop_code : // z = ~(x ^ y), bitwise xnor + + 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") ; + default: ; + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + case GB_FIRSTI_binop_code : // z = first_i(A(i,k),y) == i + //---------------------------------------------------------------------- + + // 10 semirings: (min,max,times,plus,any) * (int32,int64) + + if (zcode == GB_INT32_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_FIRSTI_INT32" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_FIRSTI_INT32" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_FIRSTI_INT32") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_FIRSTI_INT32" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_FIRSTI_INT32" ) ; + default: ; + } + } + else if (zcode == GB_INT64_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_FIRSTI_INT64" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_FIRSTI_INT64" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_FIRSTI_INT64") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_FIRSTI_INT64" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_FIRSTI_INT64" ) ; + default: ; + } + } + break ; + + //---------------------------------------------------------------------- + case GB_FIRSTI1_binop_code : // z = first_i1(A(i,k),y) == i+1 + //---------------------------------------------------------------------- + + // 10 semirings: (min,max,times,plus,any) * (int32,int64) + + if (zcode == GB_INT32_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_FIRSTI1_INT32" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_FIRSTI1_INT32" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_FIRSTI1_INT32") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_FIRSTI1_INT32" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_FIRSTI1_INT32" ) ; + default: ; + } + } + else if (zcode == GB_INT64_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_FIRSTI1_INT64" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_FIRSTI1_INT64" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_FIRSTI1_INT64") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_FIRSTI1_INT64" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_FIRSTI1_INT64" ) ; + default: ; + } + } + break ; + + //---------------------------------------------------------------------- + case GB_FIRSTJ_binop_code : // z = first_j(A(i,k),y) == k + case GB_SECONDI_binop_code : // z = second_i(x,B(k,j)) == k + //---------------------------------------------------------------------- + + // 10 semirings: (min,max,times,plus,any) * (int32,int64) + // FIRSTJ and SECONDI are identical when used in a semiring + + if (zcode == GB_INT32_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_SECONDI_INT32" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_SECONDI_INT32" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_SECONDI_INT32") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_SECONDI_INT32" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_SECONDI_INT32" ) ; + default: ; + } + } + else if (zcode == GB_INT64_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_SECONDI_INT64" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_SECONDI_INT64" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_SECONDI_INT64") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_SECONDI_INT64" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_SECONDI_INT64" ) ; + default: ; + } + } + break ; + + //---------------------------------------------------------------------- + case GB_FIRSTJ1_binop_code : // z = first_j1(A(i,k),y) == k+1 + case GB_SECONDI1_binop_code : // z = second_i1(x,B(k,j)) == k+1 + //---------------------------------------------------------------------- + + // 10 semirings: (min,max,times,plus,any) * (int32,int64) + // FIRSTJ1 and SECONDI1 are identical when used in a semiring + + if (zcode == GB_INT32_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_SECONDI1_INT32" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_SECONDI1_INT32" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_SECONDI1_INT32") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_SECONDI1_INT32" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_SECONDI1_INT32" ) ; + default: ; + } + } + else if (zcode == GB_INT64_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_SECONDI1_INT64" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_SECONDI1_INT64" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_SECONDI1_INT64") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_SECONDI1_INT64" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_SECONDI1_INT64" ) ; + default: ; + } + } + break ; + + //---------------------------------------------------------------------- + case GB_SECONDJ_binop_code : // z = second_j(x,B(i,j)) == j + //---------------------------------------------------------------------- + + // 10 semirings: (min,max,times,plus,any) * (int32,int64) + + if (zcode == GB_INT32_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_SECONDJ_INT32" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_SECONDJ_INT32" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_SECONDJ_INT32") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_SECONDJ_INT32" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_SECONDJ_INT32" ) ; + default: ; + } + } + else if (zcode == GB_INT64_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_SECONDJ_INT64" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_SECONDJ_INT64" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_SECONDJ_INT64") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_SECONDJ_INT64" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_SECONDJ_INT64" ) ; + default: ; + } + } + break ; + + //---------------------------------------------------------------------- + case GB_SECONDJ1_binop_code : // z = second_j1(x,B(i,j)) == j+1 + //---------------------------------------------------------------------- + + // 10 semirings: (min,max,times,plus,any) * (int32,int64) + + if (zcode == GB_INT32_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_SECONDJ1_INT32" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_SECONDJ1_INT32" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_SECONDJ1_INT32") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_SECONDJ1_INT32" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_SECONDJ1_INT32" ) ; + default: ; + } + } + else if (zcode == GB_INT64_code) + { + switch (add_opcode) + { + case GB_MIN_binop_code : return ("GxB_MIN_SECONDJ1_INT64" ) ; + case GB_MAX_binop_code : return ("GxB_MAX_SECONDJ1_INT64" ) ; + case GB_TIMES_binop_code : return ("GxB_TIMES_SECONDJ1_INT64") ; + case GB_PLUS_binop_code : return ("GxB_PLUS_SECONDJ1_INT64" ) ; + case GB_ANY_binop_code : return ("GxB_ANY_SECONDJ1_INT64" ) ; + default: ; + } + } + break ; + + default: ; + } + + return (NULL) ; +} + diff --git a/GraphBLAS/Source/GB_serialize.c b/GraphBLAS/Source/GB_serialize.c index 87d61396a0..2b9591c3cc 100644 --- a/GraphBLAS/Source/GB_serialize.c +++ b/GraphBLAS/Source/GB_serialize.c @@ -14,6 +14,7 @@ // estimate the size of the blob for GrB_Matrix_serializeSize. #include "GB.h" +#include "GB_get_set.h" #include "GB_serialize.h" #define GB_FREE_WORKSPACE \ @@ -243,6 +244,14 @@ GrB_Info GB_serialize // serialize a matrix into a blob s += Ai_compressed_size ; s += Ax_compressed_size ; + // size of the GrB_NAME and GrB_EL_TYPE_STRING, including one nul byte each + char *user_name = A->user_name ; + size_t user_name_len = (user_name == NULL) ? 0 : strlen (user_name) ; + const char *eltype_string = GB_type_name_get (A->type) ; + size_t eltype_string_len = (eltype_string == NULL) ? 0 : + strlen (eltype_string) ; + s += (user_name_len + 1) + (eltype_string_len + 1) ; + //-------------------------------------------------------------------------- // return the upper bound estimate of the blob size, for dryrun //-------------------------------------------------------------------------- @@ -362,6 +371,28 @@ GrB_Info GB_serialize // serialize a matrix into a blob GB_serialize_to_blob (blob, &s, Ax_Blocks, Ax_Sblocks+1, Ax_nblocks, nthreads_max) ; + //-------------------------------------------------------------------------- + // append the GrB_NAME and GrB_EL_TYPE_STRING to the blob + //-------------------------------------------------------------------------- + + if (user_name != NULL) + { + // write the GrB_NAME of the matrix (including the nul byte) +// printf ("serialize user_name %lu:[%s]\n", s, user_name) ; + strcpy ((char *) (blob + s), user_name) ; + s += user_name_len ; + } + blob [s++] = 0 ; // terminate the GrB_NAME with a nul byte + + if (eltype_string != NULL) + { + // write the EL_TYPE_STRING of the matrix type (including the nul byte) +// printf ("serialize eltype_string %lu:[%s]\n", s, eltype_string) ; + strcpy ((char *) (blob + s), eltype_string) ; + s += eltype_string_len ; + } + blob [s++] = 0 ; // terminate the GrB_EL_TYPE_STRING with a nul byte + ASSERT (s == blob_size_required) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/GB_serialize.h b/GraphBLAS/Source/GB_serialize.h index 7de0facf18..95c57d88f3 100644 --- a/GraphBLAS/Source/GB_serialize.h +++ b/GraphBLAS/Source/GB_serialize.h @@ -104,35 +104,37 @@ GrB_Info GB_deserialize_from_blob ) ; #define GB_BLOB_HEADER_SIZE \ - sizeof (uint64_t) /* blob_size */ \ - + 11 * sizeof (int64_t) /* vlen, vdim, nvec, nvec_nonempty, */ \ - /* nvals, typesize, A[phbix]_len */ \ - + 14 * sizeof (int32_t) /* version, typecode, sparsity_control, */ \ - /* A[phbix]_nblocks, A[phbix]_method, */ \ - /* sparsity_iso_csc */ \ + sizeof (uint64_t) /* blob_size */ \ + + 11 * sizeof (int64_t) /* vlen, vdim, nvec, nvec_nonempty, */ \ + /* nvals, typesize, A[phbix]_len */ \ + + 14 * sizeof (int32_t) /* version, typecode, sparsity_control, */ \ + /* A[phbix]_nblocks, A[phbix]_method, */ \ + /* sparsity_iso_csc */ \ + 2 * sizeof (float) /* hyper_switch, bitmap_switch */ // write a scalar to the blob -#define GB_BLOB_WRITE(x,type) \ - memcpy (blob + s, &(x), sizeof (type)) ; s += sizeof (type) ; +#define GB_BLOB_WRITE(x,type) \ + memcpy (blob + s, &(x), sizeof (type)) ; \ + s += sizeof (type) ; // write an int64_t array to the blob #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) ; \ + if (n > 0) \ + { \ + memcpy (((GB_void *) blob) + s, S + 1, n * sizeof (int64_t)) ; \ + s += n * sizeof (int64_t) ; \ } // read a scalar from the blob -#define GB_BLOB_READ(x,type) \ - type x ; \ - memcpy (&x, ((GB_void *) blob) + s, sizeof (type)) ; \ +#define GB_BLOB_READ(x,type) \ + type x ; \ + memcpy (&x, ((GB_void *) blob) + s, sizeof (type)) ; \ s += sizeof (type) ; // get an int64_t pointer to an array in the blob -#define GB_BLOB_READS(S,n) \ - int64_t *S = (int64_t *) (blob + s) ; s += n * sizeof (int64_t) ; +#define GB_BLOB_READS(S,n) \ + int64_t *S = (int64_t *) (blob + s) ; \ + s += n * sizeof (int64_t) ; #endif diff --git a/GraphBLAS/Source/GB_setElement.c b/GraphBLAS/Source/GB_setElement.c index 4d2d322dbb..f7700461cc 100644 --- a/GraphBLAS/Source/GB_setElement.c +++ b/GraphBLAS/Source/GB_setElement.c @@ -223,6 +223,7 @@ 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 ; if (C->nvals == 0) { // C is empty @@ -231,28 +232,21 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar else if (Ch != NULL) { // C is hypersparse, with at least one entry - int64_t k ; - if (C->Y == NULL) - { - // C is hypersparse but does not yet have a hyper_hash - k = 0 ; - found = GB_lookup (true, Ch, C->p, C->vlen, &k, - C->nvec-1, j, &pC_start, &pC_end) ; - } - else - { - // C is hypersparse, with a hyper_hash that is already built - k = GB_hyper_hash_lookup (C->p, C->Y->p, C->Y->i, C->Y->x, - C->Y->vdim-1, j, &pC_start, &pC_end) ; - found = (k >= 0) ; - } + 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 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) ; + found = (k >= 0) ; ASSERT (GB_IMPLIES (found, j == Ch [k])) ; } else { // C is sparse - pC_start = C->p [j] ; - pC_end = C->p [j+1] ; + pC_start = Cp [j] ; + pC_end = Cp [j+1] ; found = true ; } diff --git a/GraphBLAS/Source/GB_status_code.c b/GraphBLAS/Source/GB_status_code.c index 180f5baa57..46c24c9cae 100644 --- a/GraphBLAS/Source/GB_status_code.c +++ b/GraphBLAS/Source/GB_status_code.c @@ -30,6 +30,7 @@ const char *GB_status_code (GrB_Info info) case GrB_INDEX_OUT_OF_BOUNDS : return ("GrB_INDEX_OUT_OF_BOUNDS") ; case GrB_PANIC : return ("GrB_PANIC") ; case GrB_NOT_IMPLEMENTED : return ("GrB_NOT_IMPLEMENTED") ; + case GrB_ALREADY_SET : return ("GrB_ALREADY_SET") ; case GrB_EMPTY_OBJECT : return ("GrB_EMPTY_OBJECT") ; default : return ("unknown GrB_Info value!") ; } diff --git a/GraphBLAS/Source/GB_subassign_06n.c b/GraphBLAS/Source/GB_subassign_06n.c index f327a14454..5fc3619e19 100644 --- a/GraphBLAS/Source/GB_subassign_06n.c +++ b/GraphBLAS/Source/GB_subassign_06n.c @@ -89,10 +89,10 @@ GrB_Info GB_subassign_06n GrB_BinaryOp accum = NULL ; GB_OK (GB_hyper_hash_build (A, Werk)) ; - const int64_t *restrict A_Yp = (A_is_hyper) ? A->Y->p : NULL ; - const int64_t *restrict A_Yi = (A_is_hyper) ? A->Y->i : NULL ; - const int64_t *restrict A_Yx = (A_is_hyper) ? A->Y->x : NULL ; - const int64_t A_hash_bits = (A_is_hyper) ? (A->Y->vdim - 1) : 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 int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; //-------------------------------------------------------------------------- // Method 06n: C(I,J) = A ; no S diff --git a/GraphBLAS/Source/GB_subref_phase0.c b/GraphBLAS/Source/GB_subref_phase0.c index ead990a359..b85999dc8c 100644 --- a/GraphBLAS/Source/GB_subref_phase0.c +++ b/GraphBLAS/Source/GB_subref_phase0.c @@ -327,10 +327,10 @@ GrB_Info GB_subref_phase0 GB_OK (GB_hyper_hash_build (A, Werk)) ; } - const int64_t *restrict A_Yp = (use_hyper_hash) ? A->Y->p : NULL ; - const int64_t *restrict A_Yi = (use_hyper_hash) ? A->Y->i : NULL ; - const int64_t *restrict A_Yx = (use_hyper_hash) ? A->Y->x : NULL ; - const int64_t A_hash_bits = (use_hyper_hash) ? (A->Y->vdim - 1) : 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 int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; //-------------------------------------------------------------------------- // determine # of threads to use @@ -486,7 +486,7 @@ GrB_Info GB_subref_phase0 { // find jA using the hyper_hash int64_t ignore1, ignore2 ; - kA = GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, + kA = GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, jA, &ignore1, &ignore2) ; found = (kA >= 0) ; } @@ -683,7 +683,7 @@ GrB_Info GB_subref_phase0 { // find jA using the hyper_hash int64_t ignore1, ignore2 ; - kA = GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, + kA = GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, jA, &ignore1, &ignore2) ; found = (kA >= 0) ; } diff --git a/GraphBLAS/Source/GB_transplant.c b/GraphBLAS/Source/GB_transplant.c index c492d99dc4..d5a8ab19a8 100644 --- a/GraphBLAS/Source/GB_transplant.c +++ b/GraphBLAS/Source/GB_transplant.c @@ -14,8 +14,8 @@ // 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, and C->static_header -// are not modified by the transplant. +// 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. #define GB_FREE_ALL \ { \ diff --git a/GraphBLAS/Source/GB_type_code_get.c b/GraphBLAS/Source/GB_type_code_get.c new file mode 100644 index 0000000000..b0c3609555 --- /dev/null +++ b/GraphBLAS/Source/GB_type_code_get.c @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// 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. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Type_Code GB_type_code_get // return the GrB_Type_Code for the code +( + const GB_Type_code code // type code to convert +) +{ + + ASSERT (code >= 0 && code <= GB_UDT_code) ; + switch (code) + { + case GB_BOOL_code : return (GrB_BOOL_CODE) ; + case GB_INT8_code : return (GrB_INT8_CODE) ; + case GB_INT16_code : return (GrB_INT16_CODE) ; + case GB_INT32_code : return (GrB_INT32_CODE) ; + case GB_INT64_code : return (GrB_INT64_CODE) ; + case GB_UINT8_code : return (GrB_UINT8_CODE) ; + case GB_UINT16_code : return (GrB_UINT16_CODE) ; + case GB_UINT32_code : return (GrB_UINT32_CODE) ; + case GB_UINT64_code : return (GrB_UINT64_CODE) ; + case GB_FP32_code : return (GrB_FP32_CODE) ; + case GB_FP64_code : return (GrB_FP64_CODE) ; + case GB_FC32_code : return (GxB_FC32_CODE) ; + case GB_FC64_code : return (GxB_FC64_CODE) ; + default: + case GB_UDT_code : return (GrB_UDT_CODE) ; + } +} + diff --git a/GraphBLAS/Source/GB_type_name_get.c b/GraphBLAS/Source/GB_type_name_get.c new file mode 100644 index 0000000000..5ab8f2d278 --- /dev/null +++ b/GraphBLAS/Source/GB_type_name_get.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_type_name_get: get the user_name of a type +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +const char *GB_type_name_get (GrB_Type type) +{ + + if (type == NULL) + { + return (NULL) ; + } + + return (GB_code_name_get (type->code, type->user_name)) ; +} + diff --git a/GraphBLAS/Source/GB_unop_new.c b/GraphBLAS/Source/GB_unop_new.c index 6b8bee30d4..d4486fc9c5 100644 --- a/GraphBLAS/Source/GB_unop_new.c +++ b/GraphBLAS/Source/GB_unop_new.c @@ -42,6 +42,8 @@ GrB_Info GB_unop_new //-------------------------------------------------------------------------- op->magic = GB_MAGIC ; + op->user_name = NULL ; + op->user_name_size = 0 ; op->xtype = xtype ; op->ztype = ztype ; op->ytype = NULL ; @@ -65,7 +67,6 @@ GrB_Info GB_unop_new // output: op->name, &(op->name_len), &(op->hash), &(op->defn), &(op->defn_size), // input: - unop_name, unop_defn, "GxB_unary_function", 18, - opcode == GB_USER_unop_code, jitable)) ; + unop_name, unop_defn, opcode == GB_USER_unop_code, jitable)) ; } diff --git a/GraphBLAS/Source/GB_user_name_set.c b/GraphBLAS/Source/GB_user_name_set.c new file mode 100644 index 0000000000..7b9bed82be --- /dev/null +++ b/GraphBLAS/Source/GB_user_name_set.c @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// GB_user_name_set: set the user_name of an object +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +GrB_Info GB_user_name_set +( + // input/output + char **object_user_name, // user_name of the object + size_t *object_user_name_size, // user_name_size of the object + // input + const char *new_name, // new name for the object + const bool only_once // if true, the name of the object can + // only be set once +) +{ + + if (only_once && (*object_user_name) != NULL) + { + // types, operators, monoids, and semirings can have their GrB_NAME + // set at most once + return (GrB_ALREADY_SET) ; + } + + // free the object user_name, if it already exists + GB_FREE (object_user_name, (*object_user_name_size)) ; + (*object_user_name_size) = 0 ; + + // get the length of the new name + size_t len = strlen (new_name) ; + if (len == 0) + { + // no new name; leave the object unnamed + return (GrB_SUCCESS) ; + } + + // allocate the new name + size_t user_name_size ; + char *user_name = GB_MALLOC (len + 1, char, &user_name_size) ; + if (user_name == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + + // set the new user_name + strcpy (user_name, new_name) ; + (*object_user_name) = user_name ; + (*object_user_name_size) = user_name_size ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GrB_BinaryOp_get.c b/GraphBLAS/Source/GrB_BinaryOp_get.c new file mode 100644 index 0000000000..39e0ba7ed0 --- /dev/null +++ b/GraphBLAS/Source/GrB_BinaryOp_get.c @@ -0,0 +1,149 @@ +//------------------------------------------------------------------------------ +// GrB_BinaryOp_get_*: get a field in a binary op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_BinaryOp_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_BinaryOp_get_Scalar +( + GrB_BinaryOp op, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_BinaryOp_get_Scalar (op, value, 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)) ; +} + +//------------------------------------------------------------------------------ +// GrB_BinaryOp_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_BinaryOp_get_String +( + GrB_BinaryOp op, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_BinaryOp_get_String (op, value, 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 (value) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_string_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_BinaryOp_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_BinaryOp_get_INT32 +( + GrB_BinaryOp op, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_BinaryOp_get_INT32 (op, value, 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 (value) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_enum_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_BinaryOp_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_BinaryOp_get_SIZE +( + GrB_BinaryOp op, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_BinaryOp_get_SIZE (op, value, 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 (value) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_size_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_BinaryOp_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_BinaryOp_get_VOID +( + GrB_BinaryOp op, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_BinaryOp_new.c b/GraphBLAS/Source/GrB_BinaryOp_new.c index ee36f2900f..ca659a44ad 100644 --- a/GraphBLAS/Source/GrB_BinaryOp_new.c +++ b/GraphBLAS/Source/GrB_BinaryOp_new.c @@ -7,17 +7,9 @@ //------------------------------------------------------------------------------ -// GrB_BinaryOp_new is implemented both as a macro and a function. Both are -// user-callable. The macro is used by default since it can capture the name -// of the binary function. - #include "GB.h" -// the macro version of this function must first be #undefined -#undef GrB_BinaryOp_new -#undef GrM_BinaryOp_new - -GrB_Info GRB (BinaryOp_new) +GrB_Info GrB_BinaryOp_new ( GrB_BinaryOp *binaryop, // handle for the new binary operator GxB_binary_function function, // pointer to the binary function diff --git a/GraphBLAS/Source/GrB_BinaryOp_set.c b/GraphBLAS/Source/GrB_BinaryOp_set.c new file mode 100644 index 0000000000..9a72236c4d --- /dev/null +++ b/GraphBLAS/Source/GrB_BinaryOp_set.c @@ -0,0 +1,85 @@ +//------------------------------------------------------------------------------ +// GrB_BinaryOp_set_*: set a field in a binary op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_BinaryOp_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_BinaryOp_set_Scalar +( + GrB_BinaryOp op, + GrB_Scalar value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_BinaryOp_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_BinaryOp_set_String +( + GrB_BinaryOp op, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_BinaryOp_set_String (op, value, field)") ; + if (op != GxB_IGNORE_DUP) + { + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + ASSERT_BINARYOP_OK (op, "binaryop for set", GB0) ; + } + GB_RETURN_IF_NULL (value) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_op_string_set ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_BinaryOp_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_BinaryOp_set_INT32 +( + GrB_BinaryOp op, + int32_t value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_BinaryOp_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_BinaryOp_set_VOID +( + GrB_BinaryOp op, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Descriptor_free.c b/GraphBLAS/Source/GrB_Descriptor_free.c index d39db520d0..acff7daefd 100644 --- a/GraphBLAS/Source/GrB_Descriptor_free.c +++ b/GraphBLAS/Source/GrB_Descriptor_free.c @@ -25,6 +25,8 @@ GrB_Info GrB_Descriptor_free // free a descriptor if (desc != NULL) { size_t header_size = desc->header_size ; + // free the Descriptor user_name + GB_FREE (&(desc->user_name), desc->user_name_size) ; if (header_size > 0) { GB_FREE (&(desc->logger), desc->logger_size) ; diff --git a/GraphBLAS/Source/GrB_Descriptor_get2.c b/GraphBLAS/Source/GrB_Descriptor_get2.c new file mode 100644 index 0000000000..8f9340af52 --- /dev/null +++ b/GraphBLAS/Source/GrB_Descriptor_get2.c @@ -0,0 +1,283 @@ +//------------------------------------------------------------------------------ +// GrB_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 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ + +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 +) +{ + + //-------------------------------------------------------------------------- + // get the parameter + //-------------------------------------------------------------------------- + + switch (field) + { + case GrB_OUTP : + + (*value) = (int32_t) ((desc == NULL) ? GrB_DEFAULT : desc->out) ; + break ; + + case GrB_MASK : + + (*value) = (int32_t) ((desc == NULL) ? GrB_DEFAULT : desc->mask) ; + break ; + + case GrB_INP0 : + + (*value) = (int32_t) ((desc == NULL) ? GrB_DEFAULT : desc->in0) ; + break ; + + case GrB_INP1 : + + (*value) = (int32_t) ((desc == NULL) ? GrB_DEFAULT : desc->in1) ; + break ; + + case GxB_AxB_METHOD : + + (*value) = (int32_t) ((desc == NULL) ? GrB_DEFAULT : desc->axb) ; + break ; + + case GxB_SORT : + + (*value) = (int32_t) ((desc == NULL) ? GrB_DEFAULT : desc->do_sort); + break ; + + case GxB_COMPRESSION : + + (*value) = (int32_t) ((desc == NULL) ? + GrB_DEFAULT : desc->compression) ; + break ; + + case GxB_IMPORT : + + (*value) = (int32_t) ((desc == NULL) ? GrB_DEFAULT : desc->import) ; + if ((*value) != GrB_DEFAULT) (*value) = GxB_SECURE_IMPORT ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Descriptor_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Descriptor_get_Scalar +( + GrB_Descriptor desc, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + int32_t i ; + GrB_Info info = GB_desc_get (desc, &i, field) ; + if (info == GrB_SUCCESS) + { + info = GB_setElement ((GrB_Matrix) value, NULL, &i, 0, 0, + GB_INT32_code, Werk) ; + } + return (info) ; +} + +//------------------------------------------------------------------------------ +// GrB_Descriptor_get_String +//------------------------------------------------------------------------------ + +#define DNAME(d) \ +{ \ + if (desc == d) \ + { \ + strcpy (value, #d) ; \ + return (GrB_SUCCESS) ; \ + } \ +} + +GrB_Info GrB_Descriptor_get_String +( + GrB_Descriptor desc, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Descriptor_get_String (desc, value, field)") ; + GB_RETURN_IF_FAULTY (desc) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_DESCRIPTOR_OK_OR_NULL (desc, "desc for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the name + //-------------------------------------------------------------------------- + + DNAME (GrB_NULL ) ; + DNAME (GrB_DESC_T1 ) ; + DNAME (GrB_DESC_T0 ) ; + DNAME (GrB_DESC_T0T1 ) ; + + DNAME (GrB_DESC_C ) ; + DNAME (GrB_DESC_CT1 ) ; + DNAME (GrB_DESC_CT0 ) ; + DNAME (GrB_DESC_CT0T1 ) ; + + DNAME (GrB_DESC_S ) ; + DNAME (GrB_DESC_ST1 ) ; + DNAME (GrB_DESC_ST0 ) ; + DNAME (GrB_DESC_ST0T1 ) ; + + DNAME (GrB_DESC_SC ) ; + DNAME (GrB_DESC_SCT1 ) ; + DNAME (GrB_DESC_SCT0 ) ; + DNAME (GrB_DESC_SCT0T1 ) ; + + DNAME (GrB_DESC_R ) ; + DNAME (GrB_DESC_RT1 ) ; + DNAME (GrB_DESC_RT0 ) ; + DNAME (GrB_DESC_RT0T1 ) ; + + DNAME (GrB_DESC_RC ) ; + DNAME (GrB_DESC_RCT1 ) ; + DNAME (GrB_DESC_RCT0 ) ; + DNAME (GrB_DESC_RCT0T1 ) ; + + DNAME (GrB_DESC_RS ) ; + DNAME (GrB_DESC_RST1 ) ; + DNAME (GrB_DESC_RST0 ) ; + DNAME (GrB_DESC_RST0T1 ) ; + + DNAME (GrB_DESC_RSC ) ; + DNAME (GrB_DESC_RSCT1 ) ; + DNAME (GrB_DESC_RSCT0 ) ; + DNAME (GrB_DESC_RSCT0T1) ; + + // user-defined descriptor + (*value) = '\0' ; + + if (desc->user_name_size > 0) + { + // user-defined descriptor, with name defined by GrB_set + strcpy (value, desc->user_name) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Descriptor_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Descriptor_get_INT32 +( + GrB_Descriptor desc, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_desc_get (desc, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Descriptor_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_Descriptor_get_SIZE +( + GrB_Descriptor desc, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Descriptor_get_SIZE (desc, value, field)") ; + GB_RETURN_IF_FAULTY (desc) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_DESCRIPTOR_OK_OR_NULL (desc, "desc for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + if (field != GrB_NAME) + { + return (GrB_INVALID_VALUE) ; + } + + if (desc != NULL && desc->user_name != NULL) + { + (*value) = desc->user_name_size ; + } + else + { + (*value) = GxB_MAX_NAME_LEN ; + } + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Descriptor_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Descriptor_get_VOID +( + GrB_Descriptor desc, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Descriptor_new.c b/GraphBLAS/Source/GrB_Descriptor_new.c index f607a35057..7c220179f7 100644 --- a/GraphBLAS/Source/GrB_Descriptor_new.c +++ b/GraphBLAS/Source/GrB_Descriptor_new.c @@ -42,6 +42,8 @@ GrB_Info GrB_Descriptor_new // create a new descriptor GrB_Descriptor desc = *descriptor ; desc->magic = GB_MAGIC ; desc->header_size = header_size ; + desc->user_name = NULL ; // user_name for GrB_get/GrB_set + desc->user_name_size = 0 ; desc->logger = NULL ; // error string desc->logger_size = 0 ; desc->out = GxB_DEFAULT ; // descriptor for output diff --git a/GraphBLAS/Source/GrB_Descriptor_set2.c b/GraphBLAS/Source/GrB_Descriptor_set2.c new file mode 100644 index 0000000000..0fa1a4b5f3 --- /dev/null +++ b/GraphBLAS/Source/GrB_Descriptor_set2.c @@ -0,0 +1,260 @@ +//------------------------------------------------------------------------------ +// 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 "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/GrB_Global_get.c b/GraphBLAS/Source/GrB_Global_get.c new file mode 100644 index 0000000000..31850b9e39 --- /dev/null +++ b/GraphBLAS/Source/GrB_Global_get.c @@ -0,0 +1,537 @@ +//------------------------------------------------------------------------------ +// GrB_Global_get_*: get a global option +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" +#include "GB_jitifyer.h" + +//------------------------------------------------------------------------------ +// GrB_Global: an object defining the global state +//------------------------------------------------------------------------------ + +struct GB_Global_opaque GB_OPAQUE (WORLD_OBJECT) = +{ + GB_MAGIC, // magic: initialized + 0, // header_size: statically allocated +} ; + +const GrB_Global GrB_GLOBAL = & GB_OPAQUE (WORLD_OBJECT) ; + +//------------------------------------------------------------------------------ +// GB_global_enum_get: get an enum value from the global state +//------------------------------------------------------------------------------ + +static GrB_Info GB_global_enum_get (int32_t *value, int field) +{ + + switch (field) + { + + case GrB_LIBRARY_VER_MAJOR : + + (*value) = GxB_IMPLEMENTATION_MAJOR ; + break ; + + case GrB_LIBRARY_VER_MINOR : + + (*value) = GxB_IMPLEMENTATION_MINOR ; + break ; + + case GrB_LIBRARY_VER_PATCH : + + (*value) = GxB_IMPLEMENTATION_SUB ; + break ; + + case GrB_API_VER_MAJOR : + + (*value) = GxB_SPEC_MAJOR ; + break ; + + case GrB_API_VER_MINOR : + + (*value) = GxB_SPEC_MINOR ; + break ; + + case GrB_API_VER_PATCH : + + (*value) = GxB_SPEC_SUB ; + break ; + + case GrB_BLOCKING_MODE : + + // return just the GrB modes + (*value) = (int) GB_Global_mode_get ( ) ; + if ((*value) == GxB_NONBLOCKING_GPU) (*value) = GrB_NONBLOCKING ; + if ((*value) == GxB_BLOCKING_GPU) (*value) = GrB_BLOCKING ; + break ; + + case GxB_MODE : + + // return all 4 possible modes (GrB and GxB) + (*value) = (int) GB_Global_mode_get ( ) ; + break ; + + case GrB_STORAGE_ORIENTATION_HINT : + + (*value) = (int) (GB_Global_is_csc_get ( )) ? + GrB_COLMAJOR : GrB_ROWMAJOR ; + break ; + + case GxB_FORMAT : + + (*value) = (int) (GB_Global_is_csc_get ( )) ? + GxB_BY_COL : GxB_BY_ROW ; + break ; + + case GxB_GLOBAL_NTHREADS : // same as GxB_NTHREADS + + (*value) = (int) GB_Context_nthreads_max_get (NULL) ; + break ; + + case GxB_GLOBAL_GPU_ID : // same as GxB_GPU_ID + + (*value) = (int) GB_Context_gpu_id_get (NULL) ; + break ; + + case GxB_BURBLE : + + (*value) = (int) GB_Global_burble_get ( ) ; + break ; + + case GxB_LIBRARY_OPENMP : + + #ifdef _OPENMP + (*value) = (int) true ; + #else + (*value) = (int) false ; + #endif + break ; + + case GxB_PRINT_1BASED : + + (*value) = (int) GB_Global_print_one_based_get ( ) ; + break ; + + case GxB_JIT_C_CONTROL : + + (*value) = (int) GB_jitifyer_get_control ( ) ; + break ; + + case GxB_JIT_USE_CMAKE : + + (*value) = (int) GB_jitifyer_get_use_cmake ( ) ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Global_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Global_get_Scalar +( + GrB_Global g, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + int32_t i ; + GrB_Info info = GB_global_enum_get (&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, + GB_INT32_code, Werk) ; + } + else + { + double x ; + 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, + GB_FP64_code, Werk) ; + + break ; + + case GxB_GLOBAL_CHUNK : // same as GxB_CHUNK + + x = GB_Context_chunk_get (NULL) ; + info = GB_setElement ((GrB_Matrix) value, 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, + GB_INT64_code, Werk) ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + } + + return (info) ; +} + +//------------------------------------------------------------------------------ +// GB_global_string_get: get a string from the global state +//------------------------------------------------------------------------------ + +static GrB_Info GB_global_string_get (const char **value, int field) +{ + + switch ((int) field) + { + + case GrB_NAME : + case GxB_LIBRARY_NAME : + + (*value) = GxB_IMPLEMENTATION_NAME ; + break ; + + case GxB_LIBRARY_DATE : + + (*value) = GxB_IMPLEMENTATION_DATE ; + break ; + + case GxB_LIBRARY_ABOUT : + + (*value) = GxB_IMPLEMENTATION_ABOUT ; + break ; + + case GxB_LIBRARY_LICENSE : + + (*value) = GxB_IMPLEMENTATION_LICENSE ; + break ; + + case GxB_LIBRARY_COMPILE_DATE : + + (*value) = __DATE__ ; + break ; + + case GxB_LIBRARY_COMPILE_TIME : + + (*value) = __TIME__ ; + break ; + + case GxB_LIBRARY_URL : + + (*value) = "http://faculty.cse.tamu.edu/davis/GraphBLAS" ; + break ; + + case GxB_API_DATE : + + (*value) = GxB_SPEC_DATE ; + break ; + + case GxB_API_ABOUT : + + (*value) = GxB_SPEC_ABOUT ; + break ; + + case GxB_API_URL : + + (*value) = "http://graphblas.org" ; + break ; + + case GxB_COMPILER_NAME : + + (*value) = GB_COMPILER_NAME ; + break ; + + //---------------------------------------------------------------------- + // JIT configuration: + //---------------------------------------------------------------------- + + case GxB_JIT_C_COMPILER_NAME : + + (*value) = GB_jitifyer_get_C_compiler ( ) ; + break ; + + case GxB_JIT_C_COMPILER_FLAGS : + + (*value) = GB_jitifyer_get_C_flags ( ) ; + break ; + + case GxB_JIT_C_LINKER_FLAGS : + + (*value) = GB_jitifyer_get_C_link_flags ( ) ; + break ; + + case GxB_JIT_C_LIBRARIES : + + (*value) = GB_jitifyer_get_C_libraries ( ) ; + break ; + + case GxB_JIT_C_CMAKE_LIBS : + + (*value) = GB_jitifyer_get_C_cmake_libs ( ) ; + break ; + + case GxB_JIT_C_PREFACE : + + (*value) = GB_jitifyer_get_C_preface ( ) ; + break ; + + case GxB_JIT_ERROR_LOG : + + (*value) = GB_jitifyer_get_error_log ( ) ; + break ; + + case GxB_JIT_CACHE_PATH : + + (*value) = GB_jitifyer_get_cache_path ( ) ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Global_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Global_get_String +( + GrB_Global g, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Global_get_String (g, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (g) ; + GB_RETURN_IF_NULL (value) ; + (*value) = '\0' ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + const char *s ; + GrB_Info info = GB_global_string_get (&s, field) ; + if (info == GrB_SUCCESS) + { + strcpy (value, s) ; + } + #pragma omp flush + return (info) ; +} + +//------------------------------------------------------------------------------ +// GrB_Global_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Global_get_INT32 +( + GrB_Global g, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Global_get_INT32 (g, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (g) ; + GB_RETURN_IF_NULL (value) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_global_enum_get (value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Global_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_Global_get_SIZE +( + GrB_Global g, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Global_get_SIZE (g, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (g) ; + GB_RETURN_IF_NULL (value) ; + (*value) = 0 ; + + //-------------------------------------------------------------------------- + // get the size of the field + //-------------------------------------------------------------------------- + + const char *s ; + GrB_Info info = GB_global_string_get (&s, field) ; + if (info == GrB_SUCCESS) + { + (*value) = strlen (s) + 1 ; + } + else + { + switch ((int) field) + { + + case GxB_BITMAP_SWITCH : + + (*value) = sizeof (double) * GxB_NBITMAP_SWITCH ; + break ; + + case GxB_COMPILER_VERSION : + + (*value) = sizeof (int32_t) * 3 ; + break ; + + case GxB_MALLOC_FUNCTION : + case GxB_CALLOC_FUNCTION : + case GxB_REALLOC_FUNCTION : + case GxB_FREE_FUNCTION : + + (*value) = sizeof (void *) ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Global_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Global_get_VOID +( + GrB_Global g, + void * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Global_get_VOID (g, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (g) ; + GB_RETURN_IF_NULL (value) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + + case GxB_BITMAP_SWITCH : + + { + double *dvalue = (double *) value ; + for (int k = 0 ; k < GxB_NBITMAP_SWITCH ; k++) + { + dvalue [k] = (double) GB_Global_bitmap_switch_get (k) ; + } + } + break ; + + case GxB_COMPILER_VERSION : + + { + int32_t *ivalue = (int32_t *) value ; + ivalue [0] = GB_COMPILER_MAJOR ; + ivalue [1] = GB_COMPILER_MINOR ; + ivalue [2] = GB_COMPILER_SUB ; + } + break ; + + case GxB_MALLOC_FUNCTION : + { + void **func = (void **) value ; + (*func) = GB_Global_malloc_function_get ( ) ; + } + break ; + + case GxB_CALLOC_FUNCTION : + { + void **func = (void **) value ; + (*func) = GB_Global_calloc_function_get ( ) ; + } + break ; + + case GxB_REALLOC_FUNCTION : + { + void **func = (void **) value ; + (*func) = GB_Global_realloc_function_get ( ) ; + } + break ; + + case GxB_FREE_FUNCTION : + { + void **func = (void **) value ; + (*func) = GB_Global_free_function_get ( ) ; + } + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GrB_Global_set.c b/GraphBLAS/Source/GrB_Global_set.c new file mode 100644 index 0000000000..d8897cf680 --- /dev/null +++ b/GraphBLAS/Source/GrB_Global_set.c @@ -0,0 +1,320 @@ +//------------------------------------------------------------------------------ +// GrB_Global_set_*: set a global option +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" +#include "GB_jitifyer.h" + +//------------------------------------------------------------------------------ +// GB_global_enum_set: get an enum value from the global state +//------------------------------------------------------------------------------ + +static GrB_Info GB_global_enum_set (int32_t value, int field) +{ + + switch (field) + { + + case GrB_STORAGE_ORIENTATION_HINT : + + switch (value) + { + case GrB_ROWMAJOR : value = GxB_BY_ROW ; break ; + case GrB_COLMAJOR : value = GxB_BY_COL ; break ; + case GrB_BOTH : value = GxB_BY_ROW ; break ; + case GrB_UNKNOWN : value = GxB_BY_ROW ; break ; + default : return (GrB_INVALID_VALUE) ; + } + // fall through to the GxB_FORMAT case + + case GxB_FORMAT : + + if (! (value == GxB_BY_ROW || value == GxB_BY_COL)) + { + return (GrB_INVALID_VALUE) ; + } + GB_Global_is_csc_set (value != (int) GxB_BY_ROW) ; + break ; + + case GxB_GLOBAL_NTHREADS : // same as GxB_NTHREADS + + GB_Context_nthreads_max_set (NULL, value) ; + break ; + + case GxB_GLOBAL_GPU_ID : // same as GxB_GPU_ID + + GB_Context_gpu_id_set (NULL, value) ; + break ; + + case GxB_BURBLE : + + GB_Global_burble_set ((bool) value) ; + break ; + + case GxB_PRINT_1BASED : + + GB_Global_print_one_based_set ((bool) value) ; + break ; + + case GxB_JIT_USE_CMAKE : + + GB_jitifyer_set_use_cmake ((bool) value) ; + break ; + + case GxB_JIT_C_CONTROL : + + GB_jitifyer_set_control (value) ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Global_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Global_set_Scalar +( + GrB_Global g, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Global_set_Scalar (g, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (g) ; + GB_RETURN_IF_NULL_OR_FAULTY (value) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + double dvalue = 0 ; + int32_t ivalue = 0 ; + int64_t i64value = 0 ; + GrB_Info info ; + + switch ((int) field) + { + + case GxB_HYPER_SWITCH : + + info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + if (info == GrB_SUCCESS) + { + GB_Global_hyper_switch_set ((float) dvalue) ; + } + break ; + + case GxB_GLOBAL_CHUNK : // same as GxB_CHUNK + + info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + if (info == GrB_SUCCESS) + { + GB_Context_chunk_set (NULL, dvalue) ; + } + break ; + + case GxB_HYPER_HASH : + + info = GrB_Scalar_extractElement_INT64 (&i64value, value) ; + if (info == GrB_SUCCESS) + { + GB_Global_hyper_hash_set (i64value) ; + } + break ; + + default : + + info = GrB_Scalar_extractElement_INT32 (&ivalue, value) ; + if (info == GrB_SUCCESS) + { + info = GB_global_enum_set (ivalue, field) ; + } + break ; + } + + return ((info == GrB_NO_VALUE) ? GrB_EMPTY_OBJECT : info) ; +} + +//------------------------------------------------------------------------------ +// GrB_Global_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Global_set_String +( + GrB_Global g, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Global_set_String (g, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (g) ; + GB_RETURN_IF_NULL (value) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + + case GxB_JIT_C_COMPILER_NAME : + + return (GB_jitifyer_set_C_compiler (value)) ; + + case GxB_JIT_C_COMPILER_FLAGS : + + return (GB_jitifyer_set_C_flags (value)) ; + + case GxB_JIT_C_LINKER_FLAGS : + + return (GB_jitifyer_set_C_link_flags (value)) ; + + case GxB_JIT_C_LIBRARIES : + + return (GB_jitifyer_set_C_libraries (value)) ; + + case GxB_JIT_C_CMAKE_LIBS : + + return (GB_jitifyer_set_C_cmake_libs (value)) ; + + case GxB_JIT_C_PREFACE : + + return (GB_jitifyer_set_C_preface (value)) ; + + case GxB_JIT_ERROR_LOG : + + return (GB_jitifyer_set_error_log (value)) ; + + case GxB_JIT_CACHE_PATH : + + return (GB_jitifyer_set_cache_path (value)) ; + + default : + + return (GrB_INVALID_VALUE) ; + } +} + +//------------------------------------------------------------------------------ +// GrB_Global_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Global_set_INT32 +( + GrB_Global g, + int32_t value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Global_set_INT32 (g, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (g) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_global_enum_set (value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Global_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Global_set_VOID +( + GrB_Global g, + void * value, + GrB_Field field, + size_t size +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Global_set_VOID (g, value, field, size)") ; + GB_RETURN_IF_NULL_OR_FAULTY (g) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + + case GxB_BITMAP_SWITCH : + + if (value == NULL) + { + // set all switches to their default + GB_Global_bitmap_switch_default ( ) ; + } + else + { + if (size < sizeof (double) * GxB_NBITMAP_SWITCH) + { + return (GrB_INVALID_VALUE) ; + } + double *dvalue = (double *) value ; + for (int k = 0 ; k < GxB_NBITMAP_SWITCH ; k++) + { + float b = (float) dvalue [k] ; + GB_Global_bitmap_switch_set (k, b) ; + } + } + break ; + + case GxB_PRINTF : + + if (size != sizeof (GB_printf_function_t)) + { + return (GrB_INVALID_VALUE) ; + } + GB_Global_printf_set ((GB_printf_function_t) value) ; + break ; + + case GxB_FLUSH : + + if (size != sizeof (GB_flush_function_t)) + { + return (GrB_INVALID_VALUE) ; + } + GB_Global_flush_set ((GB_flush_function_t) value) ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GrB_IndexUnaryOp_get.c b/GraphBLAS/Source/GrB_IndexUnaryOp_get.c new file mode 100644 index 0000000000..d1708eaccc --- /dev/null +++ b/GraphBLAS/Source/GrB_IndexUnaryOp_get.c @@ -0,0 +1,137 @@ +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_get_*: get a field in a idxunop +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_IndexUnaryOp_get_Scalar +( + GrB_IndexUnaryOp op, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_IndexUnaryOp_get_Scalar (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL_OR_FAULTY (value) ; + ASSERT_INDEXUNARYOP_OK (op, "idxunop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_scalar_get ((GB_Operator) op, value, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_IndexUnaryOp_get_String +( + GrB_IndexUnaryOp op, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_IndexUnaryOp_get_String (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_INDEXUNARYOP_OK (op, "idxunop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_string_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_IndexUnaryOp_get_INT32 +( + GrB_IndexUnaryOp op, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_IndexUnaryOp_get_INT32 (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_INDEXUNARYOP_OK (op, "idxunop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_enum_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_IndexUnaryOp_get_SIZE +( + GrB_IndexUnaryOp op, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_IndexUnaryOp_get_SIZE (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_INDEXUNARYOP_OK (op, "idxunop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_size_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_IndexUnaryOp_get_VOID +( + GrB_IndexUnaryOp op, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_IndexUnaryOp_new.c b/GraphBLAS/Source/GrB_IndexUnaryOp_new.c index 5f35cddac0..04409be64c 100644 --- a/GraphBLAS/Source/GrB_IndexUnaryOp_new.c +++ b/GraphBLAS/Source/GrB_IndexUnaryOp_new.c @@ -7,17 +7,9 @@ //------------------------------------------------------------------------------ -// GrB_IndexUnaryOp_new is implemented both as a macro and a function. Both are -// user-callable. The macro is used by default since it can capture the name -// of the index_unary function. - #include "GB.h" -// the macro version of this function must first be #undefined -#undef GrB_IndexUnaryOp_new -#undef GrM_IndexUnaryOp_new - -GrB_Info GRB (IndexUnaryOp_new) // create a new user-defined IndexUnary op +GrB_Info GrB_IndexUnaryOp_new // create a new user-defined IndexUnary op ( GrB_IndexUnaryOp *op, // handle for the new IndexUnary operator GxB_index_unary_function function, // pointer to IndexUnary function diff --git a/GraphBLAS/Source/GrB_IndexUnaryOp_set.c b/GraphBLAS/Source/GrB_IndexUnaryOp_set.c new file mode 100644 index 0000000000..7a4ed5824a --- /dev/null +++ b/GraphBLAS/Source/GrB_IndexUnaryOp_set.c @@ -0,0 +1,82 @@ +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_set_*: set a field in a unary op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_IndexUnaryOp_set_Scalar +( + GrB_IndexUnaryOp op, + GrB_Scalar value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_IndexUnaryOp_set_String +( + GrB_IndexUnaryOp op, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_IndexUnaryOp_set_String (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_INDEXUNARYOP_OK (op, "idxunop for set", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_op_string_set ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_IndexUnaryOp_set_INT32 +( + GrB_IndexUnaryOp op, + int32_t value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_IndexUnaryOp_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_IndexUnaryOp_set_VOID +( + GrB_IndexUnaryOp op, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Matrix_get.c b/GraphBLAS/Source/GrB_Matrix_get.c new file mode 100644 index 0000000000..d2b12ed58b --- /dev/null +++ b/GraphBLAS/Source/GrB_Matrix_get.c @@ -0,0 +1,166 @@ +//------------------------------------------------------------------------------ +// GrB_Matrix_get_*: get a field in a matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Matrix_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_get_Scalar +( + GrB_Matrix A, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + ASSERT_MATRIX_OK (A, "A to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + int32_t i ; + GrB_Info 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, + GB_INT32_code, Werk) ; + } + else + { + double x ; + switch ((int) field) + { + case GxB_HYPER_SWITCH : + x = (double) (A->hyper_switch) ; + break ; + + case GxB_BITMAP_SWITCH : + x = (double) (A->bitmap_switch) ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + // field specifies a double: assign it to the scalar + info = GB_setElement ((GrB_Matrix) value, NULL, &x, 0, 0, + GB_FP64_code, Werk) ; + } + + return (info) ; +} + +//------------------------------------------------------------------------------ +// GrB_Matrix_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_get_String +( + GrB_Matrix A, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Matrix_get_String (A, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_MATRIX_OK (A, "A to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_matvec_name_get (A, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Matrix_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_get_INT32 +( + GrB_Matrix A, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Matrix_get_INT32 (A, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_MATRIX_OK (A, "A to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_matvec_enum_get (A, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Matrix_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_get_SIZE +( + GrB_Matrix A, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Matrix_get_SIZE (A, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_MATRIX_OK (A, "A to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_matvec_name_size_get (A, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Matrix_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_get_VOID +( + GrB_Matrix A, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Matrix_reduce.c b/GraphBLAS/Source/GrB_Matrix_reduce.c index 393c0b747b..e849171cf9 100644 --- a/GraphBLAS/Source/GrB_Matrix_reduce.c +++ b/GraphBLAS/Source/GrB_Matrix_reduce.c @@ -37,7 +37,7 @@ GrB_Info GB_EVAL3 (prefix, _Matrix_reduce_, T) /* c = accum (c, reduce (A)) */ \ 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) ; \ + monoid, A, Werk) ; \ GB_BURBLE_END ; \ return (info) ; \ } @@ -148,7 +148,7 @@ GrB_Info GrB_Matrix_reduce_Monoid_Scalar const GrB_Descriptor desc ) { - GB_WHERE (S, "GrB_Matrix_reduce_Monoid_Scalar (s, accum, monoid, A, 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) ; GB_BURBLE_END ; diff --git a/GraphBLAS/Source/GrB_Matrix_removeElement.c b/GraphBLAS/Source/GrB_Matrix_removeElement.c index 69b6a3cabb..722f6bd790 100644 --- a/GraphBLAS/Source/GrB_Matrix_removeElement.c +++ b/GraphBLAS/Source/GrB_Matrix_removeElement.c @@ -76,21 +76,14 @@ static inline bool GB_removeElement // return true if found // C is hypersparse: look for j in hyperlist C->h [0 ... C->nvec-1] //------------------------------------------------------------------ - int64_t k ; - if (C->Y == NULL) - { - // C is sparse but does not yet have a hyper_hash - k = 0 ; - found = GB_lookup (true, Ch, Cp, C->vlen, &k, - C->nvec-1, j, &pC_start, &pC_end) ; - } - else - { - // C is sparse, with a hyper_hash that is already built - k = GB_hyper_hash_lookup (Cp, C->Y->p, C->Y->i, C->Y->x, - C->Y->vdim-1, j, &pC_start, &pC_end) ; - found = (k >= 0) ; - } + 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 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) ; + found = (k >= 0) ; if (!found) { // vector j is empty diff --git a/GraphBLAS/Source/GrB_Matrix_set.c b/GraphBLAS/Source/GrB_Matrix_set.c new file mode 100644 index 0000000000..365907e651 --- /dev/null +++ b/GraphBLAS/Source/GrB_Matrix_set.c @@ -0,0 +1,132 @@ +//------------------------------------------------------------------------------ +// GrB_Matrix_set_*: set a field in a matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Matrix_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_set_Scalar +( + GrB_Matrix A, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + double dvalue = 0 ; + int32_t ivalue = 0 ; + GrB_Info info ; + + switch ((int) field) + { + + case GxB_HYPER_SWITCH : + case GxB_BITMAP_SWITCH : + + info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + break ; + + default : + + info = GrB_Scalar_extractElement_INT32 (&ivalue, value) ; + break ; + } + + if (info != GrB_SUCCESS) + { + return ((info == GrB_NO_VALUE) ? GrB_EMPTY_OBJECT : info) ; + } + + return (GB_matvec_set (A, false, ivalue, dvalue, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Matrix_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_set_String +( + GrB_Matrix A, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Matrix_set_String (A, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_MATRIX_OK (A, "A to set option", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_matvec_name_set (A, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Matrix_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_set_INT32 +( + GrB_Matrix A, + int32_t value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_matvec_set (A, false, value, 0, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Matrix_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_set_VOID +( + GrB_Matrix A, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Matrix_wait.c b/GraphBLAS/Source/GrB_Matrix_wait.c index 338a65ea02..602f7783b0 100644 --- a/GraphBLAS/Source/GrB_Matrix_wait.c +++ b/GraphBLAS/Source/GrB_Matrix_wait.c @@ -32,7 +32,7 @@ GrB_Info GrB_Matrix_wait // finish all work on a matrix //-------------------------------------------------------------------------- if (waitmode != GrB_COMPLETE && - (GB_ANY_PENDING_WORK (A) || GB_NEED_HYPER_HASH (A))) + (GB_ANY_PENDING_WORK (A) || GB_hyper_hash_need (A))) { GrB_Info info ; GB_BURBLE_START ("GrB_Matrix_wait") ; diff --git a/GraphBLAS/Source/GrB_Monoid_free.c b/GraphBLAS/Source/GrB_Monoid_free.c index 99934a68c4..45a36f4adc 100644 --- a/GraphBLAS/Source/GrB_Monoid_free.c +++ b/GraphBLAS/Source/GrB_Monoid_free.c @@ -22,6 +22,8 @@ GrB_Info GrB_Monoid_free // free a user-created monoid if (mon != NULL) { size_t header_size = mon->header_size ; + // free the monoid user_name + GB_FREE (&(mon->user_name), mon->user_name_size) ; if (header_size > 0) { mon->magic = GB_FREED ; // to help detect dangling pointers diff --git a/GraphBLAS/Source/GrB_Monoid_get.c b/GraphBLAS/Source/GrB_Monoid_get.c new file mode 100644 index 0000000000..823ff5aab8 --- /dev/null +++ b/GraphBLAS/Source/GrB_Monoid_get.c @@ -0,0 +1,214 @@ +//------------------------------------------------------------------------------ +// GrB_Monoid_get_*: get a field in a monoid +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Monoid_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Monoid_get_Scalar +( + GrB_Monoid monoid, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Monoid_get_Scalar (monoid, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; + GB_RETURN_IF_NULL_OR_FAULTY (value) ; + ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_monoid_get (monoid, value, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Monoid_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Monoid_get_String +( + GrB_Monoid monoid, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Monoid_get_String (monoid, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + (*value) = '\0' ; + const char *name ; + + switch ((int) field) + { + case GrB_NAME : + + // get the name of the monoid + name = GB_monoid_name_get (monoid) ; + if (name != NULL) + { + strcpy (value, name) ; + } + #pragma omp flush + return (GrB_SUCCESS) ; + + case GrB_INP0_TYPE_STRING : + case GrB_INP1_TYPE_STRING : + case GrB_OUTP_TYPE_STRING : + return (GB_op_string_get ((GB_Operator) (monoid->op), + value, field)) ; + + default : ; + return (GrB_INVALID_VALUE) ; + } +} + +//------------------------------------------------------------------------------ +// GrB_Monoid_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Monoid_get_INT32 +( + GrB_Monoid monoid, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Monoid_get_INT32 (monoid, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_enum_get ((GB_Operator) (monoid->op), value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Monoid_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_Monoid_get_SIZE +( + GrB_Monoid monoid, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Monoid_get_SIZE (monoid, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + const char *name ; + + switch ((int) field) + { + + case GrB_NAME : + + // get the length of the monoid user_name, or built-in name + name = GB_monoid_name_get (monoid) ; + break ; + + case GrB_INP0_TYPE_STRING : + case GrB_INP1_TYPE_STRING : + case GrB_OUTP_TYPE_STRING : + name = GB_type_name_get (monoid->op->ztype) ; + break ; + + case GxB_MONOID_OPERATOR : + (*value) = sizeof (GrB_BinaryOp) ; + return (GrB_SUCCESS) ; + + default : + return (GrB_INVALID_VALUE) ; + } + + (*value) = (name == NULL) ? 1 : (strlen (name) + 1) ; + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Monoid_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Monoid_get_VOID +( + GrB_Monoid monoid, + void * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Monoid_get_VOID (monoid, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + + case GxB_MONOID_OPERATOR : + memcpy (value, &(monoid->op), sizeof (GrB_BinaryOp)) ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GrB_Monoid_set.c b/GraphBLAS/Source/GrB_Monoid_set.c new file mode 100644 index 0000000000..fc1fcc7958 --- /dev/null +++ b/GraphBLAS/Source/GrB_Monoid_set.c @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// GrB_Monoid_set_*: set a field in a monoid +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Monoid_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Monoid_set_Scalar +( + GrB_Monoid monoid, + GrB_Scalar value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_Monoid_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Monoid_set_String +( + GrB_Monoid monoid, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Monoid_set_String (monoid, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; + + if (monoid->header_size == 0 || field != GrB_NAME) + { + // built-in monoids may not be modified + return (GrB_INVALID_VALUE) ; + } + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_user_name_set (&(monoid->user_name), + &(monoid->user_name_size), value, true)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Monoid_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Monoid_set_INT32 +( + GrB_Monoid monoid, + int32_t value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_Monoid_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Monoid_set_VOID +( + GrB_Monoid monoid, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Scalar_get.c b/GraphBLAS/Source/GrB_Scalar_get.c new file mode 100644 index 0000000000..0e88c2ffbe --- /dev/null +++ b/GraphBLAS/Source/GrB_Scalar_get.c @@ -0,0 +1,145 @@ +//------------------------------------------------------------------------------ +// GrB_Scalar_get_*: get a field in a scalar +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Scalar_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Scalar_get_Scalar +( + GrB_Scalar s, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + ASSERT_SCALAR_OK (s, "s to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + int32_t i ; + GrB_Info 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, + GB_INT32_code, Werk) ; + } + return (info) ; +} + +//------------------------------------------------------------------------------ +// GrB_Scalar_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Scalar_get_String +( + GrB_Scalar s, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Scalar_get_String (s, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_SCALAR_OK (s, "s to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_matvec_name_get ((GrB_Matrix) s, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Scalar_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Scalar_get_INT32 +( + GrB_Scalar s, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Scalar_get_INT32 (s, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_SCALAR_OK (s, "s to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_matvec_enum_get ((GrB_Matrix) s, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Scalar_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_Scalar_get_SIZE +( + GrB_Scalar s, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Scalar_get_SIZE (s, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_SCALAR_OK (s, "s to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_matvec_name_size_get ((GrB_Matrix) s, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Scalar_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Scalar_get_VOID +( + GrB_Scalar s, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Scalar_set.c b/GraphBLAS/Source/GrB_Scalar_set.c new file mode 100644 index 0000000000..ff7f002084 --- /dev/null +++ b/GraphBLAS/Source/GrB_Scalar_set.c @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// GrB_Scalar_set_*: set a field in a scalar +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Scalar_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Scalar_set_Scalar +( + GrB_Scalar s, + GrB_Scalar value, + GrB_Field field +) +{ + // all settings are ignored + return ((field == GrB_STORAGE_ORIENTATION_HINT) ? + GrB_SUCCESS : GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_Scalar_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Scalar_set_String +( + GrB_Scalar s, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Scalar_set_String (s, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_SCALAR_OK (s, "s to set option", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_matvec_name_set ((GrB_Matrix) s, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Scalar_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Scalar_set_INT32 +( + GrB_Scalar s, + int32_t value, + GrB_Field field +) +{ + // all settings are ignored + return ((field == GrB_STORAGE_ORIENTATION_HINT) ? + GrB_SUCCESS : GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_Scalar_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Scalar_set_VOID +( + GrB_Scalar s, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Scalar_setElement.c b/GraphBLAS/Source/GrB_Scalar_setElement.c index 59ad11bf3b..4d770d1df2 100644 --- a/GraphBLAS/Source/GrB_Scalar_setElement.c +++ b/GraphBLAS/Source/GrB_Scalar_setElement.c @@ -76,3 +76,4 @@ GrB_Info GxB_Scalar_setElement_UINT64 (GrB_Scalar s, uint64_t x) { return (GrB_S GrB_Info GxB_Scalar_setElement_FP32 (GrB_Scalar s, float x) { return (GrB_Scalar_setElement_FP32 (s,x)) ; } GrB_Info GxB_Scalar_setElement_FP64 (GrB_Scalar s, double x) { return (GrB_Scalar_setElement_FP64 (s,x)) ; } GrB_Info GxB_Scalar_setElement_UDT (GrB_Scalar s, void *x) { return (GrB_Scalar_setElement_UDT (s,x)) ; } + diff --git a/GraphBLAS/Source/GrB_Semiring_free.c b/GraphBLAS/Source/GrB_Semiring_free.c index c5f323a81e..2fcbedeb3c 100644 --- a/GraphBLAS/Source/GrB_Semiring_free.c +++ b/GraphBLAS/Source/GrB_Semiring_free.c @@ -23,6 +23,8 @@ GrB_Info GrB_Semiring_free // free a user-created semiring { // free the semiring name GB_FREE (&(s->name), s->name_size) ; + // free the semiring user_name + GB_FREE (&(s->user_name), s->user_name_size) ; // free the semiring header size_t header_size = s->header_size ; if (header_size > 0) diff --git a/GraphBLAS/Source/GrB_Semiring_get.c b/GraphBLAS/Source/GrB_Semiring_get.c new file mode 100644 index 0000000000..257137b2a0 --- /dev/null +++ b/GraphBLAS/Source/GrB_Semiring_get.c @@ -0,0 +1,241 @@ +//------------------------------------------------------------------------------ +// GrB_Semiring_get_*: get a field in a semiring +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Semiring_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Semiring_get_Scalar +( + GrB_Semiring semiring, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + case GxB_MONOID_IDENTITY : + case GxB_MONOID_TERMINAL : + return (GB_monoid_get (semiring->add, value, field, Werk)) ; + default : + return (GB_op_scalar_get ((GB_Operator) (semiring->multiply), + value, field, Werk)) ; + } +} + +//------------------------------------------------------------------------------ +// GrB_Semiring_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Semiring_get_String +( + GrB_Semiring semiring, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Semiring_get_String (semiring, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + (*value) = '\0' ; + const char *name ; + + switch ((int) field) + { + case GrB_NAME : + + name = GB_semiring_name_get (semiring) ; + if (name != NULL) + { + // get the name of the semiring + strcpy (value, name) ; + } + #pragma omp flush + return (GrB_SUCCESS) ; + + case GrB_INP0_TYPE_STRING : + case GrB_INP1_TYPE_STRING : + case GrB_OUTP_TYPE_STRING : + return (GB_op_string_get ((GB_Operator) (semiring->multiply), + value, field)) ; + + default : ; + return (GrB_INVALID_VALUE) ; + } +} + +//------------------------------------------------------------------------------ +// GrB_Semiring_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Semiring_get_INT32 +( + GrB_Semiring semiring, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Semiring_get_INT32 (semiring, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_enum_get ((GB_Operator) (semiring->multiply), value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Semiring_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_Semiring_get_SIZE +( + GrB_Semiring semiring, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Semiring_get_SIZE (semiring, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + const char *name ; + + switch ((int) field) + { + + case GrB_NAME : + + // get the length of the semiring user_name, or built-in name + name = GB_semiring_name_get (semiring) ; + break ; + + case GrB_INP0_TYPE_STRING : + name = GB_type_name_get (semiring->multiply->xtype) ; + break ; + + case GrB_INP1_TYPE_STRING : + name = GB_type_name_get (semiring->multiply->ytype) ; + break ; + + case GrB_OUTP_TYPE_STRING : + name = GB_type_name_get (semiring->multiply->ztype) ; + break ; + + case GxB_MONOID_OPERATOR : + case GxB_SEMIRING_MULTIPLY : + (*value) = sizeof (GrB_BinaryOp) ; + return (GrB_SUCCESS) ; + + case GxB_SEMIRING_MONOID : + (*value) = sizeof (GrB_Monoid) ; + return (GrB_SUCCESS) ; + + default : + return (GrB_INVALID_VALUE) ; + } + + (*value) = (name == NULL) ? 1 : (strlen (name) + 1) ; + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Semiring_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Semiring_get_VOID +( + GrB_Semiring semiring, + void * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Semiring_get_VOID (semiring, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + + case GxB_MONOID_OPERATOR : + memcpy (value, &(semiring->add->op), sizeof (GrB_BinaryOp)) ; + break ; + + case GxB_SEMIRING_MONOID : + memcpy (value, &(semiring->add), sizeof (GrB_Monoid)) ; + break ; + + case GxB_SEMIRING_MULTIPLY : + memcpy (value, &(semiring->multiply), sizeof (GrB_BinaryOp)) ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/GrB_Semiring_set.c b/GraphBLAS/Source/GrB_Semiring_set.c new file mode 100644 index 0000000000..e398567ea7 --- /dev/null +++ b/GraphBLAS/Source/GrB_Semiring_set.c @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// GrB_Semiring_set_*: set a field in a semiring +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Semiring_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Semiring_set_Scalar +( + GrB_Semiring semiring, + GrB_Scalar value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_Semiring_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Semiring_set_String +( + GrB_Semiring semiring, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Semiring_set_String (semiring, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; + + if (semiring->header_size == 0 || field != GrB_NAME) + { + // built-in semirings may not be modified + return (GrB_INVALID_VALUE) ; + } + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_user_name_set (&(semiring->user_name), + &(semiring->user_name_size), value, true)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Semiring_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Semiring_set_INT32 +( + GrB_Semiring semiring, + int32_t value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_Semiring_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Semiring_set_VOID +( + GrB_Semiring semiring, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Type_free.c b/GraphBLAS/Source/GrB_Type_free.c index 91815a0ab4..b12b9c3603 100644 --- a/GraphBLAS/Source/GrB_Type_free.c +++ b/GraphBLAS/Source/GrB_Type_free.c @@ -21,14 +21,15 @@ 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) ; + size_t defn_size = t->defn_size ; + if (defn_size > 0) + { + GB_FREE (&(t->defn), defn_size) ; + } size_t header_size = t->header_size ; if (header_size > 0) { - size_t defn_size = t->defn_size ; - if (defn_size > 0) - { - GB_FREE (&(t->defn), defn_size) ; - } t->magic = GB_FREED ; // to help detect dangling pointers t->header_size = 0 ; GB_FREE (type, header_size) ; diff --git a/GraphBLAS/Source/GrB_Type_get.c b/GraphBLAS/Source/GrB_Type_get.c new file mode 100644 index 0000000000..1b2bad06e7 --- /dev/null +++ b/GraphBLAS/Source/GrB_Type_get.c @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// GrB_Type_get_*: get a field in a type +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Type_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Type_get_Scalar +( + GrB_Type type, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + ASSERT_TYPE_OK (type, "type for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + int32_t i ; + uint64_t u ; + + switch ((int) field) + { + case GrB_EL_TYPE_CODE : + i = (int32_t) GB_type_code_get (type->code) ; + return (GB_setElement ((GrB_Matrix) value, 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, + GB_UINT64_code, Werk)) ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } +} + +//------------------------------------------------------------------------------ +// GrB_Type_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Type_get_String +( + GrB_Type type, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Type_get_String (type, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (type) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_TYPE_OK (type, "type for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + (*value) = '\0' ; + const char *name ; + + switch ((int) field) + { + case GrB_NAME : + case GrB_EL_TYPE_STRING : + + name = GB_type_name_get (type) ; + if (name != NULL) + { + strcpy (value, name) ; + } + #pragma omp flush + return (GrB_SUCCESS) ; + + case GxB_JIT_C_NAME : + + strcpy (value, type->name) ; + break ; + + case GxB_JIT_C_DEFINITION : + + if (type->defn != NULL) + { + strcpy (value, type->defn) ; + } + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Type_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Type_get_INT32 +( + GrB_Type type, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Type_get_INT32 (type, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (type) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_TYPE_OK (type, "type for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + + case GrB_EL_TYPE_CODE : + + (*value) = (int32_t) GB_type_code_get (type->code) ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Type_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_Type_get_SIZE +( + GrB_Type type, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Type_get_SIZE (type, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (type) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_TYPE_OK (type, "type for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + const char *s = NULL ; + + switch ((int) field) + { + + case GrB_SIZE : + (*value) = type->size ; + #pragma omp flush + return (GrB_SUCCESS) ; + + case GrB_NAME : + case GrB_EL_TYPE_STRING : + + s = GB_type_name_get (type) ; + break ; + + case GxB_JIT_C_NAME : + + s = type->name ; + break ; + + case GxB_JIT_C_DEFINITION : + + s = type->defn ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + (*value) = (s == NULL) ? 1 : (strlen (s) + 1) ; + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GrB_Type_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Type_get_VOID +( + GrB_Type type, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Type_new.c b/GraphBLAS/Source/GrB_Type_new.c index 0debf8f594..dcb7f242d0 100644 --- a/GraphBLAS/Source/GrB_Type_new.c +++ b/GraphBLAS/Source/GrB_Type_new.c @@ -7,26 +7,9 @@ //------------------------------------------------------------------------------ -// GrB_Type_new is implemented both as a macro and a function. Both are -// user-callable. The default is to use the macro, since this allows the name -// of the type to be saved as a string, for subsequent error reporting by -// GrB_error and for the return value of GxB_Matrix_type_name. It is also -// provided as a function so that applications that require a function instead -// of macro can access it. User code can simply do #undef GrB_Type_new before -// using the function. This approach also places the function GrB_Type_new in -// the linkable SuiteSparse:GraphBLAS library so that it is visible for linking -// with applications in languages other than ANSI C. The function version does -// not allow the name of the ctype to be saved in the new GraphBLAS type, -// however. It is given a generic name, "user_type_of_size_%d" where "%d" is -// the size of the type. - #include "GB.h" -// the macro version of this function must first be #undefined -#undef GrB_Type_new -#undef GrM_Type_new - -GrB_Info GRB (Type_new) // create a new GraphBLAS type +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 diff --git a/GraphBLAS/Source/GrB_Type_set.c b/GraphBLAS/Source/GrB_Type_set.c new file mode 100644 index 0000000000..3fa6b4b95f --- /dev/null +++ b/GraphBLAS/Source/GrB_Type_set.c @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// GrB_Type_set_*: set a field in a type +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Type_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Type_set_Scalar +( + GrB_Type type, + GrB_Scalar value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_Type_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Type_set_String +( + GrB_Type type, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Type_set_String (type, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (type) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_TYPE_OK (type, "unaryop for get", GB0) ; + + //-------------------------------------------------------------------------- + // set the name or defn of a user-defined type + //-------------------------------------------------------------------------- + + bool user_defined = (type->code == GB_UDT_code) ; + + return (GB_op_or_type_string_set (user_defined, true, value, field, + &(type->user_name), &(type->user_name_size), + type->name, &(type->name_len), &(type->defn), &(type->defn_size), + &(type->hash))) ; +} + +//------------------------------------------------------------------------------ +// GrB_Type_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Type_set_INT32 +( + GrB_Type type, + int32_t value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_Type_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Type_set_VOID +( + GrB_Type type, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_UnaryOp_get.c b/GraphBLAS/Source/GrB_UnaryOp_get.c new file mode 100644 index 0000000000..1a88de4c5b --- /dev/null +++ b/GraphBLAS/Source/GrB_UnaryOp_get.c @@ -0,0 +1,137 @@ +//------------------------------------------------------------------------------ +// GrB_UnaryOp_get_*: get a field in a unary op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_UnaryOp_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_UnaryOp_get_Scalar +( + GrB_UnaryOp op, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + ASSERT_UNARYOP_OK (op, "unaryop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_scalar_get ((GB_Operator) op, value, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GrB_UnaryOp_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_UnaryOp_get_String +( + GrB_UnaryOp op, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_UnaryOp_get_String (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_UNARYOP_OK (op, "unaryop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_string_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_UnaryOp_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_UnaryOp_get_INT32 +( + GrB_UnaryOp op, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_UnaryOp_get_INT32 (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_UNARYOP_OK (op, "unaryop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_enum_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_UnaryOp_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_UnaryOp_get_SIZE +( + GrB_UnaryOp op, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_UnaryOp_get_SIZE (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_UNARYOP_OK (op, "unaryop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_size_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_UnaryOp_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_UnaryOp_get_VOID +( + GrB_UnaryOp op, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_UnaryOp_new.c b/GraphBLAS/Source/GrB_UnaryOp_new.c index f21dc59c9d..bf4c77860c 100644 --- a/GraphBLAS/Source/GrB_UnaryOp_new.c +++ b/GraphBLAS/Source/GrB_UnaryOp_new.c @@ -7,17 +7,9 @@ //------------------------------------------------------------------------------ -// GrB_UnaryOp_new is implemented both as a macro and a function. Both are -// user-callable. The macro is used by default since it can capture the name -// of the unary function. - #include "GB.h" -// the macro version of this function must first be #undefined -#undef GrB_UnaryOp_new -#undef GrM_UnaryOp_new - -GrB_Info GRB (UnaryOp_new) // create a new user-defined unary operator +GrB_Info GrB_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 diff --git a/GraphBLAS/Source/GrB_UnaryOp_set.c b/GraphBLAS/Source/GrB_UnaryOp_set.c new file mode 100644 index 0000000000..bf92f6d71a --- /dev/null +++ b/GraphBLAS/Source/GrB_UnaryOp_set.c @@ -0,0 +1,82 @@ +//------------------------------------------------------------------------------ +// GrB_UnaryOp_set_*: set a field in a unary op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_UnaryOp_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_UnaryOp_set_Scalar +( + GrB_UnaryOp op, + GrB_Scalar value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_UnaryOp_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_UnaryOp_set_String +( + GrB_UnaryOp op, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_UnaryOp_set_String (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_UNARYOP_OK (op, "unaryop for set", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_op_string_set ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_UnaryOp_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_UnaryOp_set_INT32 +( + GrB_UnaryOp op, + int32_t value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_UnaryOp_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_UnaryOp_set_VOID +( + GrB_UnaryOp op, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Vector_get.c b/GraphBLAS/Source/GrB_Vector_get.c new file mode 100644 index 0000000000..8eb0aef5df --- /dev/null +++ b/GraphBLAS/Source/GrB_Vector_get.c @@ -0,0 +1,162 @@ +//------------------------------------------------------------------------------ +// GrB_Vector_get_*: get a field in a matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Vector_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_get_Scalar +( + GrB_Vector v, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + ASSERT_VECTOR_OK (v, "v to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + int32_t i ; + GrB_Info 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, + GB_INT32_code, Werk) ; + } + else + { + double x ; + switch ((int) field) + { + case GxB_BITMAP_SWITCH : + x = (double) (v->bitmap_switch) ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + // field specifies a double: assign it to the scalar + info = GB_setElement ((GrB_Matrix) value, NULL, &x, 0, 0, + GB_FP64_code, Werk) ; + } + + return (info) ; +} + +//------------------------------------------------------------------------------ +// GrB_Vector_get_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_get_String +( + GrB_Vector v, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Vector_get_String (v, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_VECTOR_OK (v, "v to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_matvec_name_get ((GrB_Matrix) v, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Vector_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_get_INT32 +( + GrB_Vector v, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Vector_get_INT32 (v, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_VECTOR_OK (v, "v to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_matvec_enum_get ((GrB_Matrix) v, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Vector_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_get_SIZE +( + GrB_Vector v, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Vector_get_SIZE (v, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_VECTOR_OK (v, "v to get option", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_matvec_name_size_get ((GrB_Matrix) v, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Vector_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_get_VOID +( + GrB_Vector v, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_Vector_set.c b/GraphBLAS/Source/GrB_Vector_set.c new file mode 100644 index 0000000000..aae8adb393 --- /dev/null +++ b/GraphBLAS/Source/GrB_Vector_set.c @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// GrB_Vector_set_*: set a field in a vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GrB_Vector_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_set_Scalar +( + GrB_Vector v, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Vector_set_Scalar (v, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (v) ; + ASSERT_VECTOR_OK (v, "v to set option", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + double dvalue = 0 ; + int32_t ivalue = 0 ; + GrB_Info info ; + + switch ((int) field) + { + case GxB_BITMAP_SWITCH : + info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + break ; + default : + info = GrB_Scalar_extractElement_INT32 (&ivalue, value) ; + break ; + } + + if (info != GrB_SUCCESS) + { + return ((info == GrB_NO_VALUE) ? GrB_EMPTY_OBJECT : info) ; + } + return (GB_matvec_set ((GrB_Matrix) v, true, ivalue, dvalue, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Vector_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_set_String +( + GrB_Vector v, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Vector_set_String (v, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_VECTOR_OK (v, "v to set option", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_matvec_name_set ((GrB_Matrix) v, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Vector_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_set_INT32 +( + GrB_Vector v, + int32_t value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GrB_Vector_set_INT32 (v, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (v) ; + ASSERT_VECTOR_OK (v, "v to set option", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_matvec_set ((GrB_Matrix) v, true, value, 0, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Vector_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_set_VOID +( + GrB_Vector v, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GrB_init.c b/GraphBLAS/Source/GrB_init.c index c4d4375a2d..d0204449d4 100644 --- a/GraphBLAS/Source/GrB_init.c +++ b/GraphBLAS/Source/GrB_init.c @@ -29,7 +29,7 @@ GrB_Info GrB_init // start up GraphBLAS // initialize GraphBLAS //-------------------------------------------------------------------------- - // default: use the ANSI C11 malloc memory manager, which is thread-safe + // default: use the C11 malloc memory manager, which is thread-safe return (GB_init (mode, // blocking or non-blocking mode malloc, calloc, realloc, free, // ANSI C memory management functions diff --git a/GraphBLAS/Source/GxB_Context_free.c b/GraphBLAS/Source/GxB_Context_free.c index bdf817f52f..32b975961b 100644 --- a/GraphBLAS/Source/GxB_Context_free.c +++ b/GraphBLAS/Source/GxB_Context_free.c @@ -34,6 +34,8 @@ GrB_Info GxB_Context_free // free a Context if (Context != NULL) { size_t header_size = Context->header_size ; + // free the Context user_name + GB_FREE (&(Context->user_name), Context->user_name_size) ; if (header_size > 0) { Context->magic = GB_FREED ; // to help detect dangling pointers diff --git a/GraphBLAS/Source/GxB_Context_get.c b/GraphBLAS/Source/GxB_Context_get.c index c4549a7bf9..927325bd7b 100644 --- a/GraphBLAS/Source/GxB_Context_get.c +++ b/GraphBLAS/Source/GxB_Context_get.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GxB_Context_get: get a field of a Context +// 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. diff --git a/GraphBLAS/Source/GxB_Context_get2.c b/GraphBLAS/Source/GxB_Context_get2.c new file mode 100644 index 0000000000..7a8a5a5ea4 --- /dev/null +++ b/GraphBLAS/Source/GxB_Context_get2.c @@ -0,0 +1,229 @@ +//------------------------------------------------------------------------------ +// GxB_Context_get_*: get a field in a context +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GxB_Context_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GxB_Context_get_Scalar +( + GxB_Context Context, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // 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) ; + ASSERT_CONTEXT_OK (Context, "context for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + double dvalue = 0 ; + int32_t ivalue = 0 ; + GrB_Info info ; + + switch ((int) field) + { + + case GxB_CONTEXT_CHUNK : // same as GxB_CHUNK + + dvalue = GB_Context_chunk_get (Context) ; + break ; + + case GxB_CONTEXT_NTHREADS : // same as GxB_NTHREADS + + ivalue = GB_Context_nthreads_max_get (Context) ; + break ; + + case GxB_CONTEXT_GPU_ID : // same as GxB_GPU_ID + + ivalue= GB_Context_gpu_id_get (Context) ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + + switch ((int) field) + { + + case GxB_CONTEXT_CHUNK : // same as GxB_CHUNK + + info = GB_setElement ((GrB_Matrix) value, NULL, &dvalue, 0, 0, + GB_FP64_code, Werk) ; + break ; + + default : + info = GB_setElement ((GrB_Matrix) value, NULL, &ivalue, 0, 0, + GB_INT32_code, Werk) ; + break ; + } + + return (info) ; +} + +//------------------------------------------------------------------------------ +// GxB_Context_get_String +//------------------------------------------------------------------------------ + +GrB_Info GxB_Context_get_String +( + GxB_Context Context, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_Context_get_String (Context, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (Context) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_CONTEXT_OK (Context, "context for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + if (field != GrB_NAME) + { + return (GrB_INVALID_VALUE) ; + } + + (*value) = '\0' ; + if (Context == GxB_CONTEXT_WORLD) + { + // built-in Context + strcpy (value, "GxB_CONTEXT_WORLD") ; + } + else if (Context->user_name_size > 0) + { + // user-defined Context, with name defined by GrB_set + strcpy (value, Context->user_name) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GxB_Context_get_INT +//------------------------------------------------------------------------------ + +GrB_Info GxB_Context_get_INT +( + GxB_Context Context, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_Context_get_INT (Context, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (Context) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_CONTEXT_OK (Context, "context for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + + case GxB_CONTEXT_NTHREADS : // same as GxB_NTHREADS + + (*value) = GB_Context_nthreads_max_get (Context) ; + break ; + + case GxB_CONTEXT_GPU_ID : // same as GxB_GPU_ID + + (*value) = GB_Context_gpu_id_get (Context) ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; + } + + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GxB_Context_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GxB_Context_get_SIZE +( + GxB_Context Context, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_Context_get_SIZE (Context, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (Context) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_CONTEXT_OK (Context, "context for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + if (field != GrB_NAME) + { + return (GrB_INVALID_VALUE) ; + } + + if (Context->user_name != NULL) + { + (*value) = Context->user_name_size ; + } + else + { + (*value) = GxB_MAX_NAME_LEN ; + } + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GxB_Context_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GxB_Context_get_VOID +( + GxB_Context Context, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GxB_Context_new.c b/GraphBLAS/Source/GxB_Context_new.c index 360bb0b7cb..ad0e7d9de9 100644 --- a/GraphBLAS/Source/GxB_Context_new.c +++ b/GraphBLAS/Source/GxB_Context_new.c @@ -41,6 +41,8 @@ GrB_Info GxB_Context_new // create a new Context Context->magic = GB_MAGIC ; Context->header_size = header_size ; + Context->user_name = NULL ; // user_name for GrB_get/GrB_set + Context->user_name_size = 0 ; // initialize the Context with the same settings as GxB_CONTEXT_WORLD Context->nthreads_max = GB_Context_nthreads_max_get (NULL) ; diff --git a/GraphBLAS/Source/GxB_Context_set.c b/GraphBLAS/Source/GxB_Context_set.c index ffa7eb1a34..ece98c8ee8 100644 --- a/GraphBLAS/Source/GxB_Context_set.c +++ b/GraphBLAS/Source/GxB_Context_set.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GxB_Context_set: set a field in a Context +// 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. diff --git a/GraphBLAS/Source/GxB_Context_set2.c b/GraphBLAS/Source/GxB_Context_set2.c new file mode 100644 index 0000000000..dd5dabea2c --- /dev/null +++ b/GraphBLAS/Source/GxB_Context_set2.c @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// GxB_Context_set_*: set a field in a Context +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" + +//------------------------------------------------------------------------------ +// GxB_Context_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GxB_Context_set_Scalar +( + GxB_Context Context, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_Context_set_Scalar (Context, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (Context) ; + GB_RETURN_IF_NULL_OR_FAULTY (value) ; + ASSERT_CONTEXT_OK (Context, "Context to set", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + GrB_Info info ; + int32_t ivalue = 0 ; + double dvalue = 0 ; + + switch ((int) field) + { + + 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) ; + break ; + + case GxB_CONTEXT_CHUNK : // same as GxB_CHUNK + info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + break ; + + default : + info = GrB_INVALID_VALUE ; + break ; + } + + if (info != GrB_SUCCESS) + { + return ((info == GrB_NO_VALUE) ? GrB_EMPTY_OBJECT : info) ; + } + + switch ((int) field) + { + + default: + case GxB_CONTEXT_NTHREADS : // same as GxB_NTHREADS + + GB_Context_nthreads_max_set (Context, ivalue) ; + break ; + + case GxB_CONTEXT_GPU_ID : // same as GxB_GPU_ID + + GB_Context_gpu_id_set (Context, ivalue) ; + break ; + + case GxB_CONTEXT_CHUNK : // same as GxB_CHUNK + + GB_Context_chunk_set (Context, dvalue) ; + break ; + } + + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GxB_Context_set_String +//------------------------------------------------------------------------------ + +GrB_Info GxB_Context_set_String +( + GxB_Context Context, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_Context_set_String (Context, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (Context) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_CONTEXT_OK (Context, "Context to get option", GB0) ; + + if (Context == GxB_CONTEXT_WORLD || field != GrB_NAME) + { + // built-in GxB_CONTEXT_WORLD may not be modified + return (GrB_INVALID_VALUE) ; + } + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_user_name_set (&(Context->user_name), + &(Context->user_name_size), value, false)) ; +} + +//------------------------------------------------------------------------------ +// GxB_Context_set_INT +//------------------------------------------------------------------------------ + +GrB_Info GxB_Context_set_INT +( + GxB_Context Context, + int32_t value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_Context_set_INT (Context, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (Context) ; + ASSERT_CONTEXT_OK (Context, "Context to set", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + switch ((int) field) + { + + case GxB_CONTEXT_NTHREADS : // same as GxB_NTHREADS + + GB_Context_nthreads_max_set (Context, value) ; + break ; + + case GxB_CONTEXT_GPU_ID : // same as GxB_GPU_ID + + GB_Context_gpu_id_set (Context, value) ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GxB_Context_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GxB_Context_set_VOID +( + GxB_Context Context, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GxB_IndexUnaryOp_new.c b/GraphBLAS/Source/GxB_IndexUnaryOp_new.c index 2993e85392..17f9d227c3 100644 --- a/GraphBLAS/Source/GxB_IndexUnaryOp_new.c +++ b/GraphBLAS/Source/GxB_IndexUnaryOp_new.c @@ -63,6 +63,8 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp //-------------------------------------------------------------------------- op->magic = GB_MAGIC ; + op->user_name = NULL ; + op->user_name_size = 0 ; op->ztype = ztype ; op->xtype = xtype ; op->ytype = ytype ; // thunk type @@ -87,7 +89,7 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp // output: op->name, &(op->name_len), &(op->hash), &(op->defn), &(op->defn_size), // input: - idxop_name, idxop_defn, "GxB_index_unary_function", 24, true, jitable) ; + idxop_name, idxop_defn, true, jitable) ; if (info != GrB_SUCCESS) { // out of memory diff --git a/GraphBLAS/Source/GxB_Matrix_serialize.c b/GraphBLAS/Source/GxB_Matrix_serialize.c index 181299823b..7674c64c24 100644 --- a/GraphBLAS/Source/GxB_Matrix_serialize.c +++ b/GraphBLAS/Source/GxB_Matrix_serialize.c @@ -12,7 +12,7 @@ // This method is similar to GrB_Matrix_serialize. In contrast with the GrB* // method, this method allocates the blob itself, and hands over the allocated // space to the user application. The blob must be freed by the same free -// function passed in to GxB_init, or by the ANSI C11 free() if GrB_init was +// function passed in to GxB_init, or by the C11 free() if GrB_init was // used. On input, the blob_size need not be initialized; it is returned as // the size of the blob as allocated. diff --git a/GraphBLAS/Source/GxB_Serialized_get.c b/GraphBLAS/Source/GxB_Serialized_get.c new file mode 100644 index 0000000000..5d5a22a7da --- /dev/null +++ b/GraphBLAS/Source/GxB_Serialized_get.c @@ -0,0 +1,532 @@ +//------------------------------------------------------------------------------ +// GxB_Serialized_get_*: query the contents of a serialized blob +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_get_set.h" +#include "GB_serialize.h" + +//------------------------------------------------------------------------------ +// GB_blob_header_get: get all properties of the blob +//------------------------------------------------------------------------------ + +static GrB_Info GB_blob_header_get +( + // output: + char *type_name, // name of the type (char array of size at + // least GxB_MAX_NAME_LEN) + int32_t *type_code, // type code of the matrix + int32_t *sparsity_status, // sparsity status + int32_t *sparsity_ctrl, // sparsity control + double *hyper_sw, // hyper_switch + double *bitmap_sw, // bitmap_switch + 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 + + // input, not modified: + const GB_void *blob, // the blob + GrB_Index blob_size // size of the blob +) +{ + + //-------------------------------------------------------------------------- + // read the content of the header (160 bytes) + //-------------------------------------------------------------------------- + + size_t s = 0 ; + + if (blob_size < GB_BLOB_HEADER_SIZE) + { + // blob is invalid + return (GrB_INVALID_OBJECT) ; + } + + GB_BLOB_READ (blob_size2, uint64_t) ; + GB_BLOB_READ (typecode, int32_t) ; + uint64_t blob_size1 = (uint64_t) blob_size ; + + 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 is invalid + return (GrB_INVALID_OBJECT) ; + } + + GB_BLOB_READ (version, int32_t) ; + GB_BLOB_READ (vlen, int64_t) ; + GB_BLOB_READ (vdim, int64_t) ; + GB_BLOB_READ (nvec, int64_t) ; + GB_BLOB_READ (nvec_nonempty, int64_t) ; ASSERT (nvec_nonempty >= 0) ; + GB_BLOB_READ (nvals, int64_t) ; + GB_BLOB_READ (typesize, int64_t) ; + GB_BLOB_READ (Cp_len, int64_t) ; + GB_BLOB_READ (Ch_len, int64_t) ; + GB_BLOB_READ (Cb_len, int64_t) ; + GB_BLOB_READ (Ci_len, int64_t) ; + 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) ; + 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) ; + GB_BLOB_READ (Cb_nblocks, int32_t) ; GB_BLOB_READ (Cb_method, int32_t) ; + GB_BLOB_READ (Ci_nblocks, int32_t) ; GB_BLOB_READ (Ci_method, int32_t) ; + 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) ; + (*sparsity_ctrl) = sparsity_control ; + (*hyper_sw) = (double) hyper_switch ; + (*bitmap_sw) = (double) bitmap_switch ; + (*storage) = (is_csc) ? GrB_COLMAJOR : GrB_ROWMAJOR ; + + //-------------------------------------------------------------------------- + // determine the matrix type_code and C type_name + //-------------------------------------------------------------------------- + + (*type_code) = GB_type_code_get (typecode) ; + memset (type_name, 0, GxB_MAX_NAME_LEN) ; + + if (typecode >= GB_BOOL_code && typecode < GB_UDT_code) + { + // blob has a built-in type; the name is not in the blob + strcpy (type_name, GB_code_string (typecode)) ; + } + else if (typecode == GB_UDT_code) + { + // blob has a user-defined type + // get the GxB_JIT_C_NAME of the user type from the blob + memcpy (type_name, ((GB_void *) blob) + GB_BLOB_HEADER_SIZE, + GxB_MAX_NAME_LEN) ; + s += GxB_MAX_NAME_LEN ; + } + + // this should already be in the blob, but set it to null just in case + type_name [GxB_MAX_NAME_LEN-1] = '\0' ; +// printf ("JIT C type name [%s]\n", type_name) ; + + //-------------------------------------------------------------------------- + // get the compressed block sizes from the blob for each array + //-------------------------------------------------------------------------- + + GB_BLOB_READS (Cp_Sblocks, Cp_nblocks) ; + GB_BLOB_READS (Ch_Sblocks, Ch_nblocks) ; + GB_BLOB_READS (Cb_Sblocks, Cb_nblocks) ; + GB_BLOB_READS (Ci_Sblocks, Ci_nblocks) ; + GB_BLOB_READS (Cx_Sblocks, Cx_nblocks) ; + + //-------------------------------------------------------------------------- + // skip past each array (Cp, Ch, Cb, Ci, and Cx) + //-------------------------------------------------------------------------- + + switch (*sparsity_status) + { + case GxB_HYPERSPARSE : + // skip Cp, Ch, and Ci + s += (Cp_nblocks > 0) ? Cp_Sblocks [Cp_nblocks-1] : 0 ; + s += (Ch_nblocks > 0) ? Ch_Sblocks [Ch_nblocks-1] : 0 ; + s += (Ci_nblocks > 0) ? Ci_Sblocks [Ci_nblocks-1] : 0 ; + break ; + + case GxB_SPARSE : + // skip Cp and Ci + s += (Cp_nblocks > 0) ? Cp_Sblocks [Cp_nblocks-1] : 0 ; + s += (Ci_nblocks > 0) ? Ci_Sblocks [Ci_nblocks-1] : 0 ; + break ; + + case GxB_BITMAP : + // skip Cb + s += (Cb_nblocks > 0) ? Cb_Sblocks [Cb_nblocks-1] : 0 ; + break ; + + case GxB_FULL : + break ; + default: ; + } + + // skip Cx + s += (Cx_nblocks > 0) ? Cx_Sblocks [Cx_nblocks-1] : 0 ; + + //-------------------------------------------------------------------------- + // get the GrB_NAME and GrB_EL_TYPE_STRING + //-------------------------------------------------------------------------- + + // 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. + + (*user_name) = NULL ; + (*eltype_string) = NULL ; + + if (version >= GxB_VERSION (8,1,0)) + { + + //---------------------------------------------------------------------- + // look for the two nul bytes in blob [s : blob_size-1] + //---------------------------------------------------------------------- + + int nfound = 0 ; + size_t ss [2] ; + for (size_t p = s ; p < blob_size && nfound < 2 ; p++) + { + if (blob [p] == 0) + { + ss [nfound++] = p ; + } + } + + if (nfound == 2) + { + // extract the GrB_NAME and GrB_EL_TYPE_STRING from the blob + (*user_name) = (char *) (blob + s) ; + (*eltype_string) = (char *) (blob + ss [0] + 1) ; +// printf ("deserialize user_name %lu:[%s] eltype %lu:[%s]\n", +// s, *user_name, ss [0] + 1, *eltype_string) ; + } + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + #pragma omp flush + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GxB_Serialized_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GxB_Serialized_get_Scalar +( + const void * blob, + GrB_Scalar value, + GrB_Field field, + 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 + //-------------------------------------------------------------------------- + + 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 + //-------------------------------------------------------------------------- + + double dvalue = 0 ; + int32_t ivalue = 0 ; + bool is_double = false ; + + if (info == GrB_SUCCESS) + { + switch ((int) field) + { + case GrB_STORAGE_ORIENTATION_HINT : + + ivalue = storage ; + break ; + + case GrB_EL_TYPE_CODE : + + ivalue = type_code ; + break ; + + case GxB_SPARSITY_CONTROL : + + ivalue = sparsity_ctrl ; + break ; + + case GxB_SPARSITY_STATUS : + + ivalue = sparsity_status ; + break ; + + case GxB_FORMAT : + + ivalue = (storage == GrB_COLMAJOR) ? GxB_BY_COL : GxB_BY_ROW ; + break ; + + case GxB_HYPER_SWITCH : + dvalue = hyper_sw ; + is_double = true ; + break ; + + case GxB_BITMAP_SWITCH : + dvalue = bitmap_sw ; + is_double = true ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + + 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) ; + } + } + + #pragma omp flush + return (info) ; +} + +//------------------------------------------------------------------------------ +// GxB_Serialized_get_String +//------------------------------------------------------------------------------ + +GrB_Info GxB_Serialized_get_String +( + const void * blob, + char * value, + GrB_Field field, + size_t blob_size +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_Serialized_get_String (blob, value, field, blobsize)") ; + GB_RETURN_IF_NULL (blob) ; + GB_RETURN_IF_NULL (value) ; + + //-------------------------------------------------------------------------- + // 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 ; + + if (info == GrB_SUCCESS) + { + switch (field) + { + + 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) ; + } + } + + #pragma omp flush + return (info) ; +} + +//------------------------------------------------------------------------------ +// GxB_Serialized_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GxB_Serialized_get_INT32 +( + const void * blob, + int32_t * value, + GrB_Field field, + size_t blob_size +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_Serialized_get_INT32 (blob, value, field, blobsize)") ; + GB_RETURN_IF_NULL (blob) ; + GB_RETURN_IF_NULL (value) ; + + //-------------------------------------------------------------------------- + // 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 : + + (*value) = storage ; + break ; + + case GrB_EL_TYPE_CODE : + + (*value) = type_code ; + break ; + + case GxB_SPARSITY_CONTROL : + + (*value) = sparsity_ctrl ; + break ; + + case GxB_SPARSITY_STATUS : + + (*value) = sparsity_status ; + break ; + + case GxB_FORMAT : + + (*value) = (storage == GrB_COLMAJOR) ? GxB_BY_COL : GxB_BY_ROW ; + break ; + + default : + return (GrB_INVALID_VALUE) ; + } + } + + #pragma omp flush + return (info) ; +} + +//------------------------------------------------------------------------------ +// GxB_Serialized_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GxB_Serialized_get_SIZE +( + const void * blob, + size_t * value, + GrB_Field field, + size_t blob_size +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_Serialized_get_SIZE (blob, value, field, blobsize)") ; + GB_RETURN_IF_NULL (blob) ; + GB_RETURN_IF_NULL (value) ; + + //-------------------------------------------------------------------------- + // 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 ; + + default : + return (GrB_INVALID_VALUE) ; + } + } + #pragma omp flush + return (info) ; +} + +//------------------------------------------------------------------------------ +// GxB_Serialized_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GxB_Serialized_get_VOID +( + const void * blob, + void * value, + GrB_Field field, + size_t blob_size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/GraphBLAS/Source/GxB_Type_from_name.c b/GraphBLAS/Source/GxB_Type_from_name.c index 407e9187fc..57d02ed6d5 100644 --- a/GraphBLAS/Source/GxB_Type_from_name.c +++ b/GraphBLAS/Source/GxB_Type_from_name.c @@ -7,10 +7,10 @@ //------------------------------------------------------------------------------ -// GxB_Type_from_name returns the built-in GrB_Type corresponding to the -// C name of the type as a string. For user-defined types, type is returned -// as NULL. This is not an error condition. This allows the user to write -// code such as this: +// GxB_Type_from_name returns the built-in GrB_Type corresponding to the C name +// of the type as a string, or the GraphBLAS name of the type. For +// user-defined types, type is returned as NULL. This is not an error +// condition. This allows the user to write code such as this: /* typedef struct { double x ; char stuff [16] ; } myfirsttype ; @@ -25,11 +25,14 @@ // ... create a matrix A of some built-in or user-defined type // later on, to query the type of A: + GrB_Scalar tsize ; + GrB_Scalar_new (&tsize, GrB_UINT32) ; + GrB_get (type, tsize, GrB_SIZE) ; // works for any type size_t typesize ; - GxB_Type_size (&typesize, type) ; // works for any type + GrB_Scalar_extractElement (&typesize, tsize) ; GrB_Type atype ; char atype_name [GxB_MAX_NAME_LEN] ; - GxB_Matrix_type_name (atype_name, A) ; + GrB_get (A, atype_name, GrB_NAME) ; GxB_Type_from_name (&atype, atype_name) ; if (atype == NULL) { @@ -57,8 +60,8 @@ // 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 will eventually -// removed from the user guide. Use the string-based type mechanism instead. +// won't be removed, to preserve backward compatibility, but it is removed from +// the user guide. Use the string-based type mechanism instead. #include "GB.h" @@ -81,22 +84,23 @@ GrB_Info GxB_Type_from_name // return the GrB_Type from a name //-------------------------------------------------------------------------- #define MATCH(s) (strncmp (type_name, s, GxB_MAX_NAME_LEN) == 0) - - if (MATCH ("bool" )) (*type) = GrB_BOOL ; - else if (MATCH ("int8_t" )) (*type) = GrB_INT8 ; - else if (MATCH ("int16_t" )) (*type) = GrB_INT16 ; - else if (MATCH ("int32_t" )) (*type) = GrB_INT32 ; - else if (MATCH ("int64_t" )) (*type) = GrB_INT64 ; - else if (MATCH ("uint8_t" )) (*type) = GrB_UINT8 ; - else if (MATCH ("uint16_t" )) (*type) = GrB_UINT16 ; - else if (MATCH ("uint32_t" )) (*type) = GrB_UINT32 ; - else if (MATCH ("uint64_t" )) (*type) = GrB_UINT64 ; - else if (MATCH ("float" )) (*type) = GrB_FP32 ; - else if (MATCH ("double" )) (*type) = GrB_FP64 ; - else if (MATCH ("float complex" )) (*type) = GxB_FC32 ; - else if (MATCH ("GxB_FC32_t" )) (*type) = GxB_FC32 ; - else if (MATCH ("double complex")) (*type) = GxB_FC64 ; - else if (MATCH ("GxB_FC64_t" )) (*type) = GxB_FC64 ; + #define MATCH2(s1,s2) MATCH (s1) || MATCH (s2) + + if (MATCH2 ("bool" , "GrB_BOOL" )) (*type) = GrB_BOOL ; + else if (MATCH2 ("int8_t" , "GrB_INT8" )) (*type) = GrB_INT8 ; + else if (MATCH2 ("int16_t" , "GrB_INT16" )) (*type) = GrB_INT16 ; + else if (MATCH2 ("int32_t" , "GrB_INT32" )) (*type) = GrB_INT32 ; + else if (MATCH2 ("int64_t" , "GrB_INT64" )) (*type) = GrB_INT64 ; + else if (MATCH2 ("uint8_t" , "GrB_UINT8" )) (*type) = GrB_UINT8 ; + else if (MATCH2 ("uint16_t" , "GrB_UINT16")) (*type) = GrB_UINT16 ; + else if (MATCH2 ("uint32_t" , "GrB_UINT32")) (*type) = GrB_UINT32 ; + else if (MATCH2 ("uint64_t" , "GrB_UINT64")) (*type) = GrB_UINT64 ; + else if (MATCH2 ("float" , "GrB_FP32" )) (*type) = GrB_FP32 ; + else if (MATCH2 ("double" , "GrB_FP64" )) (*type) = GrB_FP64 ; + else if (MATCH2 ("float complex" , "GxB_FC32_t")) (*type) = GxB_FC32 ; + else if (MATCH ("float _Complex" )) (*type) = GxB_FC32 ; + else if (MATCH2 ("double complex", "GxB_FC64_t")) (*type) = GxB_FC64 ; + else if (MATCH ("double _Complex" )) (*type) = GxB_FC64 ; else { // This is not an error. Returning type as NULL means that A has a diff --git a/GraphBLAS/Source/GxB_Type_new.c b/GraphBLAS/Source/GxB_Type_new.c index 3afd386e2b..eeff523ad2 100644 --- a/GraphBLAS/Source/GxB_Type_new.c +++ b/GraphBLAS/Source/GxB_Type_new.c @@ -40,7 +40,7 @@ GrB_Info GxB_Type_new ( GrB_Type *type, // handle of user type to create size_t sizeof_type, // size of the user type - const char *type_name, // name of the user type, or "sizeof (ctype)" + const char *type_name, // name of the user type const char *type_defn // typedef of the C type (any length) ) { @@ -76,6 +76,8 @@ GrB_Info GxB_Type_new // initialize the type t->header_size = header_size ; + t->user_name = NULL ; + t->user_name_size = 0 ; t->size = sizeof_type ; t->code = GB_UDT_code ; // user-defined type memset (t->name, 0, GxB_MAX_NAME_LEN) ; // no name yet @@ -83,46 +85,13 @@ GrB_Info GxB_Type_new t->defn_size = 0 ; //-------------------------------------------------------------------------- - // get the name: as a type_name or "sizeof (type_name)" + // get the name //-------------------------------------------------------------------------- if (type_name != NULL) { // copy the type_name into the working name - char working [GxB_MAX_NAME_LEN] ; - memset (working, 0, GxB_MAX_NAME_LEN) ; - strncpy (working, type_name, GxB_MAX_NAME_LEN-1) ; - - // look for "sizeof" in the name - char *p = NULL ; - p = strstr (working, "sizeof") ; - if (p != NULL) - { - // "sizeof" appears in the input string, advance past it - p += 6 ; - - // find leading "(" if it appears, and advance to one char past it - char *p2 = strstr (p, "(") ; - if (p2 != NULL) p = p2 + 1 ; - - // find trailing ")" if it appears, and delete it - p2 = strstr (p, ")") ; - if (p2 != NULL) *p2 = '\0' ; - - // p now contains the final name, copy it to the output name - strncpy (t->name, p, GxB_MAX_NAME_LEN-1) ; - } - else - { - // "sizeof" does not appear, take the input type_name as-is - memcpy (t->name, working, GxB_MAX_NAME_LEN) ; - } - } - else - { - // no type name, so give it a generic name, with the size of type only - snprintf (t->name, GxB_MAX_NAME_LEN-1, "user_type_of_size_" GBu, - (uint64_t) sizeof_type) ; + strncpy (t->name, type_name, GxB_MAX_NAME_LEN-1) ; } // ensure t->name is null-terminated @@ -132,7 +101,7 @@ GrB_Info GxB_Type_new t->name_len = (int32_t) strlen (t->name) ; // type can be JIT'd only if it has a name and defn t->hash = GB_jitifyer_hash (t->name, t->name_len, - (type_name != NULL && type_defn != NULL)) ; + (t->name_len > 0 && type_defn != NULL)) ; //-------------------------------------------------------------------------- // get the typedef, if present diff --git a/GraphBLAS/Source/GxB_Vector_serialize.c b/GraphBLAS/Source/GxB_Vector_serialize.c index ef00a5772b..ab8de201f4 100644 --- a/GraphBLAS/Source/GxB_Vector_serialize.c +++ b/GraphBLAS/Source/GxB_Vector_serialize.c @@ -12,7 +12,7 @@ // This method is similar to GxB_Matrix_serialize. Like that method, it // allocates the blob itself, and hands over the allocated space to the user // application. The blob must be freed by the same free function passed in to -// GxB_init, or by the ANSI C11 free() if GrB_init was used. On input, the +// GxB_init, or by the C11 free() if GrB_init was used. On input, the // blob_size need not be initialized; it is returned as the size of the blob as // allocated. diff --git a/GraphBLAS/Source/GxB_deserialize_type_name.c b/GraphBLAS/Source/GxB_deserialize_type_name.c index 9a69a535a7..8ef32fb32b 100644 --- a/GraphBLAS/Source/GxB_deserialize_type_name.c +++ b/GraphBLAS/Source/GxB_deserialize_type_name.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GxB_deserialize_type_name: return the name of a type +// 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. @@ -10,13 +10,16 @@ #include "GB.h" #include "GB_serialize.h" -// GxB_deserialize_type_name extracts the type_name of the GrB_Type of the -// GrB_Matrix or GrB_Vector held in a serialized blob. On input, type_name +// This method is historical; use GrB_get instead. + +// GxB_deserialize_type_name extracts the JIT C type_name of the GrB_Type of +// the GrB_Matrix or GrB_Vector held in a serialized blob. On input, type_name // must point to a user-owned char array of size at least GxB_MAX_NAME_LEN (it // must not point into the blob itself). On output, type_name will contain a // null-terminated string with the corresponding C type name. If the blob // holds a matrix of a built-in type, the name is returned as "bool" for // GrB_BOOL, "uint8_t" for GrB_UINT8, "float complex" for GxB_FC32, etc. +// If the type is user-defined, the GxB_JIT_C_NAME of the type is returned. GrB_Info GxB_deserialize_type_name // return the type name of a blob ( diff --git a/GraphBLAS/Source/GxB_init.c b/GraphBLAS/Source/GxB_init.c index b12fbaef05..d1d999caee 100644 --- a/GraphBLAS/Source/GxB_init.c +++ b/GraphBLAS/Source/GxB_init.c @@ -19,7 +19,7 @@ // Examples: // -// To use GraphBLAS with the ANSI C11 functions (or to another library +// To use GraphBLAS with the C11 functions (or to another library // linked in that replaces them): // // // either use: diff --git a/GraphBLAS/Source/Shared/GB_Operator.h b/GraphBLAS/Source/Shared/GB_Operator.h index 50f09e317a..ea197fd881 100644 --- a/GraphBLAS/Source/Shared/GB_Operator.h +++ b/GraphBLAS/Source/Shared/GB_Operator.h @@ -12,6 +12,10 @@ int64_t magic ; // for detecting uninitialized objects size_t header_size ; // size of the malloc'd block for this struct, or 0 + // ---------------------// + char *user_name ; // user name for GrB_get/GrB_set + size_t user_name_size ; // allocated size of user_name for GrB_get/GrB_set + // ---------------------// GrB_Type ztype ; // type of z GrB_Type xtype ; // type of x @@ -23,8 +27,8 @@ GxB_index_unary_function idxunop_function ; GxB_binary_function binop_function ; - char name [GxB_MAX_NAME_LEN] ; // name of the operator - int32_t name_len ; // length of user-defined name; 0 for builtin + char name [GxB_MAX_NAME_LEN] ; // JIT C name of the operator + int32_t name_len ; // length of JIT C name; 0 for builtin GB_Opcode opcode ; // operator opcode char *defn ; // function definition size_t defn_size ; // allocated size of the definition diff --git a/GraphBLAS/Source/Shared/GB_assign_shared_definitions.h b/GraphBLAS/Source/Shared/GB_assign_shared_definitions.h index c9dc7e79b4..ae5ff10df6 100644 --- a/GraphBLAS/Source/Shared/GB_assign_shared_definitions.h +++ b/GraphBLAS/Source/Shared/GB_assign_shared_definitions.h @@ -82,10 +82,10 @@ #define GB_GET_C_HYPER_HASH \ GB_OK (GB_hyper_hash_build (C, Werk)) ; \ - const int64_t *restrict C_Yp = (C_is_hyper) ? C->Y->p : NULL ; \ - const int64_t *restrict C_Yi = (C_is_hyper) ? C->Y->i : NULL ; \ - const int64_t *restrict C_Yx = (C_is_hyper) ? C->Y->x : NULL ; \ - const int64_t C_hash_bits = (C_is_hyper) ? (C->Y->vdim - 1) : 0 ; + 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 int64_t C_hash_bits = (C->Y == NULL) ? 0 : (C->Y->vdim - 1) ; //------------------------------------------------------------------------------ // GB_GET_MASK: get the mask matrix M @@ -111,10 +111,10 @@ #define GB_GET_MASK_HYPER_HASH \ GB_OK (GB_hyper_hash_build (M, Werk)) ; \ - const int64_t *restrict M_Yp = (M_is_hyper) ? M->Y->p : NULL ; \ - const int64_t *restrict M_Yi = (M_is_hyper) ? M->Y->i : NULL ; \ - const int64_t *restrict M_Yx = (M_is_hyper) ? M->Y->x : NULL ; \ - const int64_t M_hash_bits = (M_is_hyper) ? (M->Y->vdim - 1) : 0 ; + 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 int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; //------------------------------------------------------------------------------ // GB_GET_ACCUM: get the accumulator op and its related typecasting functions @@ -220,10 +220,10 @@ 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_is_hyper) ? S->Y->p : NULL ; \ - const int64_t *restrict S_Yi = (S_is_hyper) ? S->Y->i : NULL ; \ - const int64_t *restrict S_Yx = (S_is_hyper) ? S->Y->x : NULL ; \ - const int64_t S_hash_bits = (S_is_hyper) ? (S->Y->vdim - 1) : 0 ; + 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 int64_t S_hash_bits = (S->Y == NULL) ? 0 : (S->Y->vdim - 1) ; //------------------------------------------------------------------------------ // basic actions @@ -1277,8 +1277,8 @@ { \ if (X ## _is_hyper) \ { \ - GB_hyper_hash_lookup (X ## p, X ## _Yp, X ## _Yi, X ## _Yx, \ - X ## _hash_bits, j, &pX_start, &pX_end) ; \ + GB_hyper_hash_lookup (X ## h, X ## nvec, X ## p, X ## _Yp, \ + X ## _Yi, X ## _Yx, X ## _hash_bits, j, &pX_start, &pX_end) ; \ } \ else \ { \ diff --git a/GraphBLAS/Source/Shared/GB_complex.h b/GraphBLAS/Source/Shared/GB_complex.h index 45ca58e2f0..d201c05913 100644 --- a/GraphBLAS/Source/Shared/GB_complex.h +++ b/GraphBLAS/Source/Shared/GB_complex.h @@ -153,7 +153,7 @@ #else //-------------------------------------------------------------------------- - // ANSI C11 + // C11 //-------------------------------------------------------------------------- #define GB_crealf(x) crealf(x) diff --git a/GraphBLAS/Source/Shared/GB_hyper_hash_lookup.h b/GraphBLAS/Source/Shared/GB_hyper_hash_lookup.h index 682d7e2115..c32640cb1d 100644 --- a/GraphBLAS/Source/Shared/GB_hyper_hash_lookup.h +++ b/GraphBLAS/Source/Shared/GB_hyper_hash_lookup.h @@ -15,6 +15,9 @@ 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 + 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 @@ -22,57 +25,79 @@ GB_STATIC_INLINE int64_t GB_hyper_hash_lookup // k if j==Ah[k]; -1 if not found const int64_t *restrict Yx, // A->Y->x const int64_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 + // output int64_t *restrict pstart, // start of vector: Ap [k] int64_t *restrict pend // end of vector: Ap [k+1] ) { - //-------------------------------------------------------------------------- - // determine the hash bucket that would contain vector j - //-------------------------------------------------------------------------- + bool found = false ; + int64_t k ; - const int64_t jhash = GB_HASHF2 (j, hash_bits) ; + if (Yp == NULL) + { - //-------------------------------------------------------------------------- - // search for j in the jhash bucket: Yi [Yp [jhash] ... Yp [jhash+1]-1] - //-------------------------------------------------------------------------- + //---------------------------------------------------------------------- + // no hyper_hash constructed + //---------------------------------------------------------------------- + + // binary search of Ah [0...A->nvec-1] for the value j + k = 0 ; + int64_t pright = anvec - 1 ; + GB_BINARY_SEARCH (j, Ah, k, pright, found) ; - const int64_t ypstart = Yp [jhash] ; - const int64_t ypend = Yp [jhash+1] ; - int64_t 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. - bool found ; - int64_t p = ypstart ; - int64_t pright = ypend - 1 ; - GB_BINARY_SEARCH (j, Yi, p, pright, found) ; - if (found) - { - k = Yx [p] ; - } } else { - // Linear-time search for j in the jhash bucket. - for (int64_t p = ypstart ; p < ypend ; p++) + + //---------------------------------------------------------------------- + // 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) { - if (j == Yi [p]) + // 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) { - // found: j = Ah [k] where k is given by k = Yx [p] k = Yx [p] ; - break ; } } + 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) ; + } } //-------------------------------------------------------------------------- // if found, return the start and end of A(:,j) //-------------------------------------------------------------------------- - if (k >= 0) + if (found) { // found: j == Ah [k], get the vector A(:,j) (*pstart) = Ap [k] ; @@ -81,6 +106,7 @@ GB_STATIC_INLINE int64_t GB_hyper_hash_lookup // k if j==Ah[k]; -1 if not found else { // not found: j is not in the hyperlist Ah [0..anvec-1] + k = -1 ; (*pstart) = -1 ; (*pend ) = -1 ; } diff --git a/GraphBLAS/Source/Shared/GB_matrix.h b/GraphBLAS/Source/Shared/GB_matrix.h index 543f95f46f..26b5e0518e 100644 --- a/GraphBLAS/Source/Shared/GB_matrix.h +++ b/GraphBLAS/Source/Shared/GB_matrix.h @@ -9,10 +9,11 @@ // The GrB_Matrix and GrB_Vector objects are different names for the same // content. A GrB_Vector is held as an m-by-1 non-hypersparse CSC matrix. -// This file is #include'd in GB_opaque.h to define the GB_Matrix_opaque and -// GB_Vector_opaque structs. It would be cleaner to define just one opaque -// struct, and then GrB_Matrix and GrB_Vector would be typedef'd as pointers to -// the same struct, but then the compiler gets confused with Generic(x). +// This file is #include'd in GB_opaque.h to define the GB_Matrix_opaque, +// GB_Vector_opaque, and GB_Scalar_opaque structs. It would be cleaner to +// define just one opaque struct, and then GrB_Matrix, GrB_Vector, GrB_Scalar +// would be typedef'd as pointers to the same struct, but then the compiler +// gets confused with _Generic(x). // For a GrB_Vector object, as an m-by-1 non-hypersparse CSC matrix: // bool is_csc ; // always true @@ -27,13 +28,18 @@ // basic information: magic, error logger, and type //------------------------------------------------------------------------------ -// The first four items exactly match the first four items in the -// GrB_Descriptor struct. +// The first four items exactly match the first four items of nearly all +// GraphBLAS objects. The first 6 match the GrB_Descriptor struct. int64_t magic ; // for detecting uninitialized objects size_t header_size ; // size of the malloc'd block for this struct, or 0 +// ---------------------// +char *user_name ; // user name for GrB_get/GrB_set +size_t user_name_size ; // allocated size of user_name for GrB_get/GrB_set +// ---------------------// char *logger ; // error logger string size_t logger_size ; // size of the malloc'd block for logger, or 0 +// ---------------------// // The remaining items are specific the GrB_Matrix, GrB_Vector and GrB_Scalar // structs, and do not appear in the GrB_Descriptor struct: diff --git a/GraphBLAS/Source/Shared/GB_opaque.h b/GraphBLAS/Source/Shared/GB_opaque.h index 884536f00d..6c175431da 100644 --- a/GraphBLAS/Source/Shared/GB_opaque.h +++ b/GraphBLAS/Source/Shared/GB_opaque.h @@ -107,8 +107,8 @@ typedef enum GB_ERF_unop_code = 35, // z = erf (x) GB_ERFC_unop_code = 36, // z = erfc (x) GB_CBRT_unop_code = 37, // z = cbrt (x) - GB_FREXPX_unop_code = 38, // z = frexpx (x), mantissa of ANSI C11 frexp - GB_FREXPE_unop_code = 39, // z = frexpe (x), exponent of ANSI C11 frexp + GB_FREXPX_unop_code = 38, // z = frexpx (x), mantissa of C11 frexp + GB_FREXPE_unop_code = 39, // z = frexpe (x), exponent of C11 frexp //-------------------------------------------------------------------------- // unary operators for complex types only @@ -358,15 +358,21 @@ GB_Opcode ; // when A->p array is allocated but not initialized. #define GB_MAGIC2 0x7265745f786f62ULL +// Nearly all GraphBLAS objects contain the same first 4 items (except for +// GB_Global_opaque, which has just the first 2). + struct GB_Type_opaque // content of GrB_Type { int64_t magic ; // for detecting uninitialized objects size_t header_size ; // size of the malloc'd block for this struct, or 0 // ---------------------// + char *user_name ; // user name for GrB_get/GrB_set + size_t user_name_size ; // allocated size of user_name for GrB_get/GrB_set + // ---------------------// size_t size ; // size of the type GB_Type_code code ; // the type code - int32_t name_len ; // length of user-defined name; 0 for builtin - char name [GxB_MAX_NAME_LEN] ; // name of the type + int32_t name_len ; // length of JIT C name; 0 for builtin + char name [GxB_MAX_NAME_LEN] ; // JIT C name of the type char *defn ; // type definition size_t defn_size ; // allocated size of the definition uint64_t hash ; // if 0, type is builtin. @@ -407,6 +413,9 @@ struct GB_Monoid_opaque // content of GrB_Monoid int64_t magic ; // for detecting uninitialized objects size_t header_size ; // size of the malloc'd block for this struct, or 0 // ---------------------// + char *user_name ; // user name for GrB_get/GrB_set + size_t user_name_size ; // allocated size of user_name for GrB_get/GrB_set + // ---------------------// GrB_BinaryOp op ; // binary operator of the monoid void *identity ; // identity of the monoid; type is op->ztype void *terminal ; // early-exit (NULL if no value); type is op->ztype @@ -421,22 +430,29 @@ struct GB_Semiring_opaque // content of GrB_Semiring int64_t magic ; // for detecting uninitialized objects size_t header_size ; // size of the malloc'd block for this struct, or 0 // ---------------------// + char *user_name ; // user name for GrB_get/GrB_set + size_t user_name_size ; // allocated size of user_name for GrB_get/GrB_set + // ---------------------// GrB_Monoid add ; // add operator of the semiring GrB_BinaryOp multiply ; // multiply operator of the semiring - char *name ; // name of the type; NULL for builtin - int32_t name_len ; // length of user-defined name; 0 for builtin + char *name ; // name of the semiring; NULL for builtin + int32_t name_len ; // length of name; 0 for builtin size_t name_size ; // allocated size of the name uint64_t hash ; // if 0, semiring uses only builtin ops and types } ; struct GB_Descriptor_opaque // content of GrB_Descriptor { - // first 4 items exactly match GrB_Matrix, GrB_Vector, GrB_Scalar structs: + // first 6 items exactly match GrB_Matrix, GrB_Vector, GrB_Scalar structs: int64_t magic ; // for detecting uninitialized objects size_t header_size ; // size of the malloc'd block for this struct, or 0 // ---------------------// + char *user_name ; // user name for GrB_get/GrB_set + size_t user_name_size ; // allocated size of user_name for GrB_get/GrB_set + // ---------------------// char *logger ; // error logger string size_t logger_size ; // size of the malloc'd block for logger, or 0 + // ---------------------// // specific to the descriptor struct: GrB_Desc_Value out ; // output descriptor GrB_Desc_Value mask ; // mask descriptor @@ -453,6 +469,9 @@ struct GB_Context_opaque // content of GxB_Context int64_t magic ; // for detecting uninitialized objects size_t header_size ; // size of the malloc'd block for this struct, or 0 // ---------------------// + char *user_name ; // user name for GrB_get/GrB_set + size_t user_name_size ; // allocated size of user_name for GrB_get/GrB_set + // ---------------------// // OpenMP thread(s): double chunk ; // chunk size for # of threads for small problems int nthreads_max ; // max # threads to use in this call to GraphBLAS diff --git a/GraphBLAS/Source/Template/GB_AxB_dot3_meta.c b/GraphBLAS/Source/Template/GB_AxB_dot3_meta.c index e1a8c3c98a..7308d4b34d 100644 --- a/GraphBLAS/Source/Template/GB_AxB_dot3_meta.c +++ b/GraphBLAS/Source/Template/GB_AxB_dot3_meta.c @@ -106,17 +106,15 @@ const bool A_iso = A->iso ; #endif - const GrB_Matrix A_Y = A->Y ; - const int64_t *restrict A_Yp = (A_is_hyper) ? A_Y->p : NULL ; - const int64_t *restrict A_Yi = (A_is_hyper) ? A_Y->i : NULL ; - const int64_t *restrict A_Yx = (A_is_hyper) ? A_Y->x : NULL ; - const int64_t A_hash_bits = (A_is_hyper) ? (A_Y->vdim - 1) : 0 ; - - const GrB_Matrix B_Y = B->Y ; - const int64_t *restrict B_Yp = (B_is_hyper) ? B_Y->p : NULL ; - const int64_t *restrict B_Yi = (B_is_hyper) ? B_Y->i : NULL ; - const int64_t *restrict B_Yx = (B_is_hyper) ? B_Y->x : NULL ; - const int64_t B_hash_bits = (B_is_hyper) ? (B_Y->vdim - 1) : 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 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 int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #if !GB_A_IS_PATTERN const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; diff --git a/GraphBLAS/Source/Template/GB_AxB_dot3_phase1_template.c b/GraphBLAS/Source/Template/GB_AxB_dot3_phase1_template.c index f02b54cff2..2cd571526d 100644 --- a/GraphBLAS/Source/Template/GB_AxB_dot3_phase1_template.c +++ b/GraphBLAS/Source/Template/GB_AxB_dot3_phase1_template.c @@ -57,8 +57,8 @@ #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 (Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, - j, &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) ; #elif GB_B_IS_SPARSE // B is sparse const int64_t pB_start = Bp [j] ; @@ -106,8 +106,8 @@ #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 (Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, - i, &pA, &pA_end) ; + GB_hyper_hash_lookup (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 diff --git a/GraphBLAS/Source/Template/GB_AxB_dot3_template.c b/GraphBLAS/Source/Template/GB_AxB_dot3_template.c index e4b41c7b92..d9cdb407d3 100644 --- a/GraphBLAS/Source/Template/GB_AxB_dot3_template.c +++ b/GraphBLAS/Source/Template/GB_AxB_dot3_template.c @@ -72,8 +72,8 @@ #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 (Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, - j, &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) ; #elif GB_B_IS_SPARSE // B is sparse const int64_t pB_start = Bp [j] ; @@ -136,8 +136,8 @@ #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 (Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, - i, &pA, &pA_end) ; + GB_hyper_hash_lookup (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 diff --git a/GraphBLAS/Source/Template/GB_AxB_saxpy3_template.c b/GraphBLAS/Source/Template/GB_AxB_saxpy3_template.c index 0775683291..cac0998879 100644 --- a/GraphBLAS/Source/Template/GB_AxB_saxpy3_template.c +++ b/GraphBLAS/Source/Template/GB_AxB_saxpy3_template.c @@ -68,17 +68,10 @@ const bool A_ok_for_binary_search = ((A_is_sparse || A_is_hyper) && !A_jumbled) ; - const int64_t *restrict A_Yp = NULL ; - const int64_t *restrict A_Yi = NULL ; - const int64_t *restrict A_Yx = NULL ; - int64_t A_hash_bits = 0 ; - if (A_is_hyper) - { - A_Yp = A->Y->p ; - A_Yi = A->Y->i ; - A_Yx = A->Y->x ; - A_hash_bits = A->Y->vdim - 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 ; + 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 ; @@ -98,18 +91,10 @@ int64_t mnvec = M->nvec ; int64_t mvlen = M->vlen ; // get the M hyper_hash - const int64_t *restrict M_Yp = NULL ; - const int64_t *restrict M_Yi = NULL ; - const int64_t *restrict M_Yx = NULL ; - int64_t M_hash_bits = 0 ; - if (M_is_hyper) - { - // mask is present, and hypersparse - M_Yp = M->Y->p ; - M_Yi = M->Y->i ; - M_Yx = M->Y->x ; - M_hash_bits = M->Y->vdim - 1 ; - } + 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 int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; #endif #if !GB_A_IS_PATTERN diff --git a/GraphBLAS/Source/Template/GB_AxB_saxpy3_template.h b/GraphBLAS/Source/Template/GB_AxB_saxpy3_template.h index d1b9a8ef89..869dc51921 100644 --- a/GraphBLAS/Source/Template/GB_AxB_saxpy3_template.h +++ b/GraphBLAS/Source/Template/GB_AxB_saxpy3_template.h @@ -24,7 +24,7 @@ if (M_is_hyper) \ { \ /* M is hypersparse: find M(:,j) in the M->Y hyper_hash */ \ - GB_hyper_hash_lookup (Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, \ + GB_hyper_hash_lookup (Mh, mnvec, Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, \ GBH_B (Bh, kk), &pM_start, &pM_end) ; \ } \ else \ @@ -229,7 +229,7 @@ if (A_is_hyper) \ { \ /* A is hypersparse: find A(:,k) in the A->Y hyper_hash */ \ - GB_hyper_hash_lookup (Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, \ + GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, \ k, &pA_start, &pA_end) ; \ } \ else \ diff --git a/GraphBLAS/Source/Template/GB_Template.h b/GraphBLAS/Source/Template/GB_Template.h index 4c85d071e4..c608047fa7 100644 --- a/GraphBLAS/Source/Template/GB_Template.h +++ b/GraphBLAS/Source/Template/GB_Template.h @@ -33,7 +33,7 @@ // Intentionally shadow the built-in "restrict" keyword. See GraphBLAS.h for // the definition of GB_restrict. It becomes empty for C++, and "__restrict" -// for MS Visual Studio. Otherwise, GB_restrict is just "restrict" on ANSI C11 +// for MS Visual Studio. Otherwise, GB_restrict is just "restrict" on C11 // compliant compilers. I prefer to use the "restrict" keyword to make the // code readable. This #define is a patch for compilers that don't support it: diff --git a/GraphBLAS/Source/Template/GB_compiler.h b/GraphBLAS/Source/Template/GB_compiler.h index 7c38e29e7c..4ee1d72b87 100644 --- a/GraphBLAS/Source/Template/GB_compiler.h +++ b/GraphBLAS/Source/Template/GB_compiler.h @@ -140,7 +140,7 @@ #if GB_COMPILER_MSC - // MS Visual Studio is not ANSI C11 compliant, and uses __pragma: + // MS Visual Studio is not C11 compliant, and uses __pragma: #define GB_PRAGMA(x) __pragma (x) // no #pragma omp simd is available in MS Visual Studio #define GB_PRAGMA_SIMD @@ -148,7 +148,7 @@ #else - // ANSI C11 compilers use _Pragma: + // C11 compilers use _Pragma: #define GB_PRAGMA(x) _Pragma (#x) // create two kinds of SIMD pragmas: // GB_PRAGMA_SIMD becomes "#pragma omp simd" diff --git a/GraphBLAS/Source/Template/GB_defaults.h b/GraphBLAS/Source/Template/GB_defaults.h index 28988faa0b..277d3fc792 100644 --- a/GraphBLAS/Source/Template/GB_defaults.h +++ b/GraphBLAS/Source/Template/GB_defaults.h @@ -17,8 +17,8 @@ // These parameters define the content of values that can be // used as inputs to GxB_*Option_set. -// The default format is by row (CSR). #define GB_HYPER_SWITCH_DEFAULT (0.0625) +#define GB_HYPER_HASH_DEFAULT (1024) // by default, give each thread at least 64K units of work to do #define GB_CHUNK_DEFAULT (64*1024) diff --git a/GraphBLAS/Source/Template/GB_math_macros.h b/GraphBLAS/Source/Template/GB_math_macros.h index f025e7763b..b694c45f9f 100644 --- a/GraphBLAS/Source/Template/GB_math_macros.h +++ b/GraphBLAS/Source/Template/GB_math_macros.h @@ -27,7 +27,7 @@ // NaN always return false, so if either x or y are NaN, then z = y, for both // min(x,y) and max(x,y). -// The ANSI C11 fmin, fminf, fmax, and fmaxf functions have the 'omitnan' +// The C11 fmin, fminf, fmax, and fmaxf functions have the 'omitnan' // behavior. These are used in SuiteSparse:GraphBLAS v2.3.0 and later. // for integers only: diff --git a/GraphBLAS/Source/Template/GB_wait_macros.h b/GraphBLAS/Source/Template/GB_wait_macros.h index 4a65848618..a9cde8c8ab 100644 --- a/GraphBLAS/Source/Template/GB_wait_macros.h +++ b/GraphBLAS/Source/Template/GB_wait_macros.h @@ -35,8 +35,5 @@ #define GB_ANY_PENDING_WORK(A) \ (GB_PENDING (A) || GB_ZOMBIES (A) || GB_JUMBLED (A)) -// true if a matrix is hypersparse but has no A->Y component -#define GB_NEED_HYPER_HASH(A) (GB_IS_HYPERSPARSE (A) && (((A)->Y) == NULL)) - #endif diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c index 0ad827c375..0ccddc9deb 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v9.0.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,9 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x31aff911c5850713 ; - v [0] = 8 ; v [1] = 3 ; v [2] = 1 ; // keep at current version + v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version + v [1] = GxB_IMPLEMENTATION_MINOR ; + v [2] = GxB_IMPLEMENTATION_SUB ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c index feb46f314d..7d30d88d5d 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v9.0.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,9 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x227f98d0b09e286f ; - v [0] = 8 ; v [1] = 3 ; v [2] = 1 ; // keep at current version + v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version + v [1] = GxB_IMPLEMENTATION_MINOR ; + v [2] = GxB_IMPLEMENTATION_SUB ; defn [0] = NULL ; defn [1] = GB_my_rdiv_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c index 957bb6c964..72155b27e9 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v9.0.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -105,7 +105,9 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xdf8cbb0c0ac7ce22 ; - v [0] = 8 ; v [1] = 3 ; v [2] = 1 ; // keep at current version + v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version + v [1] = GxB_IMPLEMENTATION_MINOR ; + v [2] = GxB_IMPLEMENTATION_SUB ; defn [0] = NULL ; defn [1] = NULL ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c index 39d0247e07..a93931aef2 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v9.0.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,9 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x422f36dae3aeca51 ; - v [0] = 8 ; v [1] = 3 ; v [2] = 1 ; // keep at current version + v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version + v [1] = GxB_IMPLEMENTATION_MINOR ; + v [2] = GxB_IMPLEMENTATION_SUB ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c index c2b3fd9ce8..19f7db91ca 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v9.0.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,9 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x654ba0e0a34027e9 ; - v [0] = 8 ; v [1] = 3 ; v [2] = 1 ; // keep at current version + v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version + v [1] = GxB_IMPLEMENTATION_MINOR ; + v [2] = GxB_IMPLEMENTATION_SUB ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c index 18bc680a26..8295437c66 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v9.0.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,9 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x98afaa59c37fb8bb ; - v [0] = 8 ; v [1] = 3 ; v [2] = 1 ; // keep at current version + v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version + v [1] = GxB_IMPLEMENTATION_MINOR ; + v [2] = GxB_IMPLEMENTATION_SUB ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c index 3b33d165b7..8dcbd183b3 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v9.0.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,9 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xfaa3c6cd7f90ec16 ; - v [0] = 8 ; v [1] = 3 ; v [2] = 1 ; // keep at current version + v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version + v [1] = GxB_IMPLEMENTATION_MINOR ; + v [2] = GxB_IMPLEMENTATION_SUB ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; 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 d1e0208abd..ababd0a961 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 v8.2.0, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v9.0.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -37,7 +37,9 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xa98ff14e387744fe ; - v [0] = 8 ; v [1] = 3 ; v [2] = 1 ; // keep at current version + v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version + v [1] = GxB_IMPLEMENTATION_MINOR ; + v [2] = GxB_IMPLEMENTATION_SUB ; defn [0] = GB_my_rdiv_USER_DEFN ; defn [1] = NULL ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/README.txt b/GraphBLAS/Tcov/README.txt index 687be5f5f7..0521baf13d 100644 --- a/GraphBLAS/Tcov/README.txt +++ b/GraphBLAS/Tcov/README.txt @@ -3,8 +3,8 @@ SPDX-License-Identifier: Apache-2.0 GraphBLAS/Tcov: statement coverage tests -Requirements: the mex command must use a C compiler supporting ANSI C11. -Microft Visual Studio does not support ANSI C11 so this test is not available +Requirements: the mex command must use a C compiler supporting C11. +Microft Visual Studio does not support C11 so this test is not available on Windows unless you use another compiler. Since nearly all GraphBLAS tests are in *.m files, I have taken the unusual diff --git a/GraphBLAS/Tcov/grbuniq.m b/GraphBLAS/Tcov/grbuniq.m new file mode 100644 index 0000000000..27ef4ccccd --- /dev/null +++ b/GraphBLAS/Tcov/grbuniq.m @@ -0,0 +1,87 @@ + +% 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/Tcov/log_Dec20.txt b/GraphBLAS/Tcov/log_Dec20.txt deleted file mode 100644 index d4a3ba8ae1..0000000000 --- a/GraphBLAS/Tcov/log_Dec20.txt +++ /dev/null @@ -1,217 +0,0 @@ - ----------------------------------------------- [malloc] [cover] -20-Dec 15:03:59 test272 0.0 sec 113: 21943 of 22139 0.9% 4063.29/s -20-Dec 15:04:00 test268 0.2 sec 131: 21812 of 22139 1.5% 782.70/s -20-Dec 15:04:01 test145 1.5 sec 293: 21519 of 22139 2.8% 193.83/s -20-Dec 15:04:01 test145 0.0 sec 3: 21516 of 22139 2.8% 74.94/s -20-Dec 15:04:01 test145 0.0 sec 26: 21490 of 22139 2.9% 1401.16/s -20-Dec 15:04:01 test145 0.0 sec 4: 21486 of 22139 2.9% 176.11/s -20-Dec 15:04:02 test145 1.0 sec 52: 21434 of 22139 3.2% 50.71/s -20-Dec 15:04:02 test145 0.0 sec 5: 21429 of 22139 3.2% 541.83/s -20-Dec 15:04:03 test240 0.6 sec 88: 21341 of 22139 3.6% 148.98/s -20-Dec 15:04:03 test240 0.2 sec 1: 21340 of 22139 3.6% 4.36/s -20-Dec 15:04:04 test237 0.8 sec 46: 21294 of 22139 3.8% 54.46/s -20-Dec 15:04:06 test237 1.9 sec 4: 21290 of 22139 3.8% 2.12/s -20-Dec 15:04:06 test237 0.1 sec 20: 21270 of 22139 3.9% 238.08/s -20-Dec 15:04:06 test237 0.0 sec 6: 21264 of 22139 4.0% 242.37/s -20-Dec 15:04:06 test237 0.1 sec 4: 21260 of 22139 4.0% 54.50/s -20-Dec 15:04:07 test267 0.4 sec 35: 21225 of 22139 4.1% 92.09/s -20-Dec 15:04:07 test267 0.0 sec 1: 21224 of 22139 4.1% 1980.20/s -20-Dec 15:04:07 test266 0.0 sec 4: 21220 of 22139 4.2% 124.46/s -20-Dec 15:04:07 test265 0.3 sec 92: 21128 of 22139 4.6% 328.48/s -20-Dec 15:04:07 test264 0.0 sec 191: 20937 of 22139 5.4% 6250.20/s -20-Dec 15:04:07 test263 0.5 sec 28: 20909 of 22139 5.6% 55.15/s -20-Dec 15:04:07 test262 0.0 sec 88: 20821 of 22139 6.0% 2977.80/s -20-Dec 15:04:08 test261 0.0 sec 29: 20792 of 22139 6.1% 1038.87/s -20-Dec 15:04:08 test260 0.0 sec 3: 20789 of 22139 6.1% 109.13/s -20-Dec 15:04:09 test259 1.4 sec 4: 20785 of 22139 6.1% 2.92/s -20-Dec 15:04:09 test258 0.2 sec 22: 20763 of 22139 6.2% 119.89/s -20-Dec 15:04:09 test257 0.1 sec 65: 20698 of 22139 6.5% 483.56/s -20-Dec 15:04:09 test255 0.0 sec 8: 20690 of 22139 6.5% 276.49/s -20-Dec 15:04:09 test254 0.1 sec 29: 20661 of 22139 6.7% 472.83/s -20-Dec 15:04:12 test254 2.8 sec 20: 20641 of 22139 6.8% 7.24/s -20-Dec 15:04:12 test254 0.1 sec 1: 20640 of 22139 6.8% 12.91/s -20-Dec 15:04:12 test253 0.1 sec 27: 20613 of 22139 6.9% 293.58/s -20-Dec 15:04:12 test252 0.0 sec 11: 20602 of 22139 6.9% 388.75/s -20-Dec 15:05:01 test251 48.9 sec 490: 20112 of 22139 9.2% 10.02/s -20-Dec 15:07:15 test251 134.2 sec 12: 20100 of 22139 9.2% 0.09/s -20-Dec 15:09:08 test251 112.2 sec 78: 20022 of 22139 9.6% 0.70/s -20-Dec 15:09:09 test250 1.5 sec 169: 19853 of 22139 10.3% 111.77/s -20-Dec 15:09:11 test250 1.8 sec 13: 19840 of 22139 10.4% 7.31/s -20-Dec 15:09:12 test249 1.0 sec 29: 19811 of 22139 10.5% 30.35/s -20-Dec 15:09:12 test247 0.0 sec 24: 19787 of 22139 10.6% 931.75/s -20-Dec 15:09:23 test246 11.3 sec 74: 19713 of 22139 11.0% 6.57/s -20-Dec 15:09:33 test01 10.0 sec 1451: 18262 of 22139 17.5% 145.31/s -20-Dec 15:09:42 test01 8.3 sec 22: 18240 of 22139 17.6% 2.65/s -20-Dec 15:09:42 test245 0.5 sec 34: 18206 of 22139 17.8% 63.46/s -20-Dec 15:09:42 test245 0.0 sec 8: 18198 of 22139 17.8% 234.28/s -20-Dec 15:09:42 test199 0.0 sec 1: 18197 of 22139 17.8% 132.47/s -20-Dec 15:09:42 test83 0.0 sec 15: 18182 of 22139 17.9% 518.62/s -20-Dec 15:09:42 test210 0.0 sec 9: 18173 of 22139 17.9% 2435.72/s -20-Dec 15:09:42 test165 0.0 sec 1: 18172 of 22139 17.9% 199.68/s -20-Dec 15:09:42 test219 0.0 sec 9: 18163 of 22139 18.0% 267.86/s -20-Dec 15:09:43 test219 0.2 sec 3: 18160 of 22139 18.0% 18.83/s -20-Dec 15:09:43 test241 0.1 sec 10: 18150 of 22139 18.0% 127.59/s -20-Dec 15:09:43 test220 0.1 sec 15: 18135 of 22139 18.1% 269.60/s -20-Dec 15:09:43 test211 0.0 sec 15: 18120 of 22139 18.2% 479.72/s -20-Dec 15:09:43 test202 0.1 sec 83: 18037 of 22139 18.5% 1230.91/s -20-Dec 15:09:43 test202 0.0 sec 1: 18036 of 22139 18.5% 25.49/s -20-Dec 15:09:45 test152 2.2 sec 827: 17209 of 22139 22.3% 370.28/s -20-Dec 15:09:49 test152 3.5 sec 13: 17196 of 22139 22.3% 3.75/s -20-Dec 15:10:30 test152 41.6 sec 245: 16951 of 22139 23.4% 5.90/s -20-Dec 15:10:30 test222 0.1 sec 18: 16933 of 22139 23.5% 269.88/s -20-Dec 15:10:31 test256 0.2 sec 50: 16883 of 22139 23.7% 318.93/s -20-Dec 15:10:32 test186 1.6 sec 42: 16841 of 22139 23.9% 25.93/s -20-Dec 15:10:33 test186 0.4 sec 1: 16840 of 22139 23.9% 2.69/s -20-Dec 15:10:33 test186(0) 0.3 sec 5: 16835 of 22139 24.0% 14.39/s -20-Dec 15:10:40 test150 7.4 sec 39: 16796 of 22139 24.1% 5.27/s -20-Dec 15:10:41 test150 0.1 sec 4: 16792 of 22139 24.2% 26.71/s -20-Dec 15:10:41 test239 0.1 sec 15: 16777 of 22139 24.2% 279.38/s -20-Dec 15:10:41 test239 0.6 sec 2: 16775 of 22139 24.2% 3.40/s -20-Dec 15:10:41 test235 0.0 sec 4: 16771 of 22139 24.2% 116.91/s -20-Dec 15:10:41 test226 0.0 sec 8: 16763 of 22139 24.3% 666.44/s -20-Dec 15:10:41 test223 0.0 sec 2: 16761 of 22139 24.3% 89.78/s -20-Dec 15:10:41 test204 0.1 sec 14: 16747 of 22139 24.4% 260.89/s -20-Dec 15:10:41 test203 0.0 sec 19: 16728 of 22139 24.4% 567.57/s -20-Dec 15:10:41 test183 0.0 sec 12: 16716 of 22139 24.5% 517.09/s -20-Dec 15:10:42 test179 0.1 sec 15: 16701 of 22139 24.6% 194.09/s -20-Dec 15:10:43 test179 1.1 sec 4: 16697 of 22139 24.6% 3.69/s -20-Dec 15:10:43 test174 0.1 sec 10: 16687 of 22139 24.6% 176.36/s -20-Dec 15:10:43 test155 0.1 sec 44: 16643 of 22139 24.8% 524.15/s -20-Dec 15:10:43 test156 0.5 sec 225: 16418 of 22139 25.8% 457.60/s -20-Dec 15:11:09 test156 25.7 sec 37: 16381 of 22139 26.0% 1.44/s -20-Dec 15:11:09 test136 0.1 sec 57: 16324 of 22139 26.3% 598.43/s -20-Dec 15:11:10 test02 0.4 sec 22: 16302 of 22139 26.4% 54.69/s -20-Dec 15:11:10 test109 0.3 sec 10: 16292 of 22139 26.4% 32.05/s -20-Dec 15:11:10 test109 0.0 sec 4: 16288 of 22139 26.4% 833.51/s -20-Dec 15:11:10 test109 0.2 sec 8: 16280 of 22139 26.5% 35.34/s -20-Dec 15:11:10 test04 0.1 sec 15: 16265 of 22139 26.5% 237.41/s -20-Dec 15:11:10 test207 0.0 sec 2: 16263 of 22139 26.5% 395.10/s -20-Dec 15:11:10 test221 0.0 sec 2: 16261 of 22139 26.6% 262.33/s -20-Dec 15:11:10 test162 0.0 sec 5: 16256 of 22139 26.6% 101.45/s -20-Dec 15:11:46 test159 35.6 sec 80: 16176 of 22139 26.9% 2.25/s -20-Dec 15:11:48 test159 1.9 sec 55: 16121 of 22139 27.2% 28.64/s -20-Dec 15:11:48 test09 0.0 sec 5: 16116 of 22139 27.2% 353.31/s -20-Dec 15:11:48 test132 0.0 sec 8: 16108 of 22139 27.2% 162.96/s -20-Dec 15:12:13 test141 24.6 sec 476: 15632 of 22139 29.4% 19.35/s -20-Dec 15:12:23 test141 9.8 sec 77: 15555 of 22139 29.7% 7.83/s -20-Dec 15:15:18 test141 175.3 sec 2: 15553 of 22139 29.7% 0.01/s -20-Dec 15:15:19 testc2(1,1) 0.8 sec 20: 15533 of 22139 29.8% 25.86/s -20-Dec 15:15:23 testc2(1,1) 3.6 sec 4: 15529 of 22139 29.9% 1.11/s -20-Dec 15:15:23 test214 0.0 sec 3: 15526 of 22139 29.9% 306.81/s -20-Dec 15:15:23 test213 0.0 sec 2: 15524 of 22139 29.9% 179.99/s -20-Dec 15:15:25 test206 1.8 sec 219: 15305 of 22139 30.9% 122.91/s -20-Dec 15:15:32 test206 7.7 sec 8: 15297 of 22139 30.9% 1.04/s -20-Dec 15:15:33 test212 0.0 sec 9: 15288 of 22139 30.9% 386.27/s -20-Dec 15:15:33 test212 0.1 sec 2: 15286 of 22139 31.0% 17.84/s -20-Dec 15:15:33 test128 0.3 sec 49: 15237 of 22139 31.2% 191.92/s -20-Dec 15:15:33 test82 0.1 sec 18: 15219 of 22139 31.3% 242.12/s -20-Dec 15:15:35 test229 2.1 sec 9: 15210 of 22139 31.3% 4.28/s -20-Dec 15:15:36 test229 1.1 sec 1: 15209 of 22139 31.3% 0.91/s -20-Dec 15:15:37 test144 0.5 sec 2: 15207 of 22139 31.3% 3.72/s -20-Dec 15:16:26 test14 49.5 sec 664: 14543 of 22139 34.3% 13.41/s -20-Dec 15:16:50 test14 23.2 sec 2: 14541 of 22139 34.3% 0.09/s -20-Dec 15:19:19 test14 149.2 sec 117: 14424 of 22139 34.8% 0.78/s -20-Dec 15:19:25 test180 5.7 sec 134: 14290 of 22139 35.5% 23.70/s -20-Dec 15:19:28 test236 3.2 sec 74: 14216 of 22139 35.8% 23.23/s -20-Dec 15:19:30 test232 2.3 sec 20: 14196 of 22139 35.9% 8.51/s -20-Dec 15:19:45 test228 14.3 sec 28: 14168 of 22139 36.0% 1.96/s -20-Dec 15:21:05 test154 80.1 sec 1502: 12666 of 22139 42.8% 18.76/s -20-Dec 15:25:50 test154 284.7 sec 2: 12664 of 22139 42.8% 0.01/s -20-Dec 15:25:57 test238 7.7 sec 50: 12614 of 22139 43.0% 6.46/s -20-Dec 15:26:36 test238 38.9 sec 2: 12612 of 22139 43.0% 0.05/s -20-Dec 15:27:39 test151b 62.8 sec 173: 12439 of 22139 43.8% 2.76/s -20-Dec 15:28:58 test151b 78.6 sec 1: 12438 of 22139 43.8% 0.01/s -20-Dec 15:33:28 test151b 270.6 sec 1: 12437 of 22139 43.8% 0.00/s -20-Dec 15:33:32 test184 3.2 sec 38: 12399 of 22139 44.0% 11.83/s -20-Dec 15:33:42 test191 10.2 sec 21: 12378 of 22139 44.1% 2.05/s -20-Dec 15:34:04 test191 21.2 sec 3: 12375 of 22139 44.1% 0.14/s -20-Dec 15:38:43 test188 279.3 sec 183: 12192 of 22139 44.9% 0.66/s -20-Dec 15:40:37 test188 113.4 sec 3: 12189 of 22139 44.9% 0.03/s -20-Dec 15:40:41 test224 3.6 sec 24: 12165 of 22139 45.1% 6.62/s -20-Dec 15:40:43 test196 2.3 sec 11: 12154 of 22139 45.1% 4.72/s -20-Dec 15:40:47 test209 4.4 sec 20: 12134 of 22139 45.2% 4.54/s -20-Dec 15:41:01 test104 13.2 sec 40: 12094 of 22139 45.4% 3.04/s -20-Dec 15:41:10 test189 9.2 sec 1: 12093 of 22139 45.4% 0.11/s -20-Dec 15:42:02 test194 52.6 sec 5: 12088 of 22139 45.4% 0.10/s -20-Dec 15:42:12 test76 10.0 sec 15: 12073 of 22139 45.5% 1.51/s -20-Dec 15:42:45 test244 32.3 sec 17: 12056 of 22139 45.5% 0.53/s -[malloc debugging turned off] -20-Dec 15:42:45 test201 0.0 sec 3: 12053 of 22139 45.6% 373.46/s -20-Dec 15:42:45 test225 0.1 sec 4: 12049 of 22139 45.6% 34.44/s -20-Dec 15:42:45 test176 0.1 sec 5: 12044 of 22139 45.6% 87.49/s -20-Dec 15:42:45 test208 0.0 sec 5: 12039 of 22139 45.6% 355.47/s -20-Dec 15:42:45 test216 0.0 sec 3: 12036 of 22139 45.6% 74.09/s -20-Dec 15:43:32 test142 47.4 sec 630: 11406 of 22139 48.5% 13.29/s -20-Dec 15:43:51 test142 18.2 sec 2: 11404 of 22139 48.5% 0.11/s -20-Dec 15:46:01 test142 130.7 sec 2: 11402 of 22139 48.5% 0.02/s -20-Dec 15:46:20 test142 17.9 sec 2: 11400 of 22139 48.5% 0.11/s -20-Dec 15:46:20 test137 0.2 sec 3: 11397 of 22139 48.5% 14.77/s -20-Dec 15:46:20 test137 0.0 sec 2: 11395 of 22139 48.5% 357.14/s -20-Dec 15:46:20 test139 0.3 sec 2: 11393 of 22139 48.5% 6.66/s -20-Dec 15:46:20 test172 0.1 sec 3: 11390 of 22139 48.6% 48.03/s -20-Dec 15:46:21 test148 0.4 sec 4: 11386 of 22139 48.6% 10.26/s -20-Dec 15:46:21 test157 0.4 sec 12: 11374 of 22139 48.6% 27.17/s -20-Dec 15:46:22 test182 0.7 sec 8: 11366 of 22139 48.7% 11.21/s -20-Dec 15:46:22 test108 0.3 sec 2: 11364 of 22139 48.7% 5.92/s -20-Dec 15:46:23 test108 0.3 sec 1: 11363 of 22139 48.7% 3.11/s -20-Dec 15:46:23 test130 0.6 sec 26: 11337 of 22139 48.8% 46.69/s -20-Dec 15:46:23 test124 0.1 sec 3: 11334 of 22139 48.8% 25.50/s -20-Dec 15:46:23 test138 0.1 sec 1: 11333 of 22139 48.8% 18.60/s -20-Dec 15:46:27 test227 3.2 sec 27: 11306 of 22139 48.9% 8.53/s -20-Dec 15:46:46 test125 19.3 sec 630: 10676 of 22139 51.8% 32.71/s -20-Dec 15:48:19 test234 93.2 sec 396: 10280 of 22139 53.6% 4.25/s -20-Dec 15:51:12 test234 172.9 sec 2: 10278 of 22139 53.6% 0.01/s -20-Dec 15:51:42 test242 30.2 sec 77: 10201 of 22139 53.9% 2.55/s -20-Dec 15:51:43 test173 1.1 sec 11: 10190 of 22139 54.0% 9.80/s -20-Dec 15:51:45 test200 1.9 sec 10: 10180 of 22139 54.0% 5.22/s -20-Dec 15:51:45 test197 0.1 sec 1: 10179 of 22139 54.0% 8.39/s -20-Dec 15:51:46 test84 0.9 sec 18: 10161 of 22139 54.1% 20.71/s -20-Dec 15:51:54 test19b 8.0 sec 58: 10103 of 22139 54.4% 7.24/s -20-Dec 15:51:58 test19b 3.9 sec 5: 10098 of 22139 54.4% 1.28/s -20-Dec 15:51:59 test133 0.3 sec 2: 10096 of 22139 54.4% 7.44/s -20-Dec 15:52:02 test80 3.3 sec 12: 10084 of 22139 54.5% 3.59/s -20-Dec 15:52:13 test151 11.3 sec 73: 10011 of 22139 54.8% 6.45/s -20-Dec 15:53:04 test151 50.5 sec 2: 10009 of 22139 54.8% 0.04/s -20-Dec 15:53:53 test23 49.1 sec 146: 9863 of 22139 55.4% 2.98/s -20-Dec 15:54:38 test23 45.3 sec 2: 9861 of 22139 55.5% 0.04/s -20-Dec 15:54:40 test135 1.4 sec 7: 9854 of 22139 55.5% 5.18/s -20-Dec 15:55:39 test160 59.8 sec 23: 9831 of 22139 55.6% 0.38/s -20-Dec 15:56:38 test160 58.6 sec 1: 9830 of 22139 55.6% 0.02/s -20-Dec 15:56:42 test54 3.8 sec 20: 9810 of 22139 55.7% 5.21/s -20-Dec 15:56:43 test129 0.8 sec 4: 9806 of 22139 55.7% 5.04/s -20-Dec 15:56:44 test69 1.5 sec 3: 9803 of 22139 55.7% 2.00/s -20-Dec 15:57:41 test230 56.3 sec 114: 9689 of 22139 56.2% 2.02/s -20-Dec 16:46:28 test74 2927.9 sec 6588: 3101 of 22139 86.0% 2.25/s -20-Dec 17:09:03 test74 1354.1 sec 7: 3094 of 22139 86.0% 0.01/s -20-Dec 17:12:49 test127 226.0 sec 1633: 1461 of 22139 93.4% 7.23/s -20-Dec 17:21:30 test127 521.0 sec 18: 1443 of 22139 93.5% 0.03/s -20-Dec 18:08:28 test127 2818.0 sec 2: 1441 of 22139 93.5% 0.00/s -20-Dec 18:09:24 test19 1.8 sec 12: 1429 of 22139 93.5% 6.57/s -20-Dec 18:09:26 test11 2.3 sec 3: 1426 of 22139 93.6% 1.31/s -20-Dec 18:09:29 test215 2.3 sec 1: 1425 of 22139 93.6% 0.43/s -20-Dec 18:09:40 test193 10.8 sec 5: 1420 of 22139 93.6% 0.46/s -20-Dec 18:11:31 test195 111.9 sec 39: 1381 of 22139 93.8% 0.35/s -20-Dec 18:11:46 test243 14.5 sec 7: 1374 of 22139 93.8% 0.48/s -20-Dec 18:11:55 test29 8.7 sec 1: 1373 of 22139 93.8% 0.11/s -20-Dec 18:12:03 test29 8.0 sec 2: 1371 of 22139 93.8% 0.25/s -20-Dec 18:12:14 testc2(0,0) 11.2 sec 2: 1369 of 22139 93.8% 0.18/s -20-Dec 18:12:15 testc2(0,0) 0.9 sec 6: 1363 of 22139 93.8% 6.51/s -20-Dec 18:12:16 testc2(0,0) 1.0 sec 1: 1362 of 22139 93.8% 0.99/s -20-Dec 18:12:16 testc4(0) 0.4 sec 4: 1358 of 22139 93.9% 10.43/s -20-Dec 18:12:28 testc7(0) 12.0 sec 1: 1357 of 22139 93.9% 0.08/s -20-Dec 18:12:32 testcc(1) 4.1 sec 1: 1356 of 22139 93.9% 0.24/s -20-Dec 18:12:38 test187 5.9 sec 3: 1353 of 22139 93.9% 0.51/s -20-Dec 18:12:42 test192 3.5 sec 1: 1352 of 22139 93.9% 0.28/s -20-Dec 18:12:51 test181 9.2 sec 10: 1342 of 22139 93.9% 1.08/s -20-Dec 18:14:07 test185 76.2 sec 6: 1336 of 22139 94.0% 0.08/s -20-Dec 18:14:35 test53 27.8 sec 4: 1332 of 22139 94.0% 0.14/s -20-Dec 18:15:07 test17 31.4 sec 28: 1304 of 22139 94.1% 0.89/s -20-Dec 18:19:23 test231 256.3 sec 162: 1142 of 22139 94.8% 0.63/s -20-Dec 18:56:19 test10 2216.5 sec 946: 196 of 22139 99.1% 0.43/s -20-Dec 19:01:07 test75b 256.6 sec 151: 45 of 22139 99.8% 0.59/s -20-Dec 19:02:09 test21b 61.0 sec 26: 19 of 22139 99.9% 0.43/s -20-Dec 19:02:52 testca(1) 42.9 sec 5: 14 of 22139 99.9% 0.12/s -20-Dec 19:04:19 test81 87.2 sec 1: 13 of 22139 99.9% 0.01/s -20-Dec 19:08:04 test18 225.0 sec 13: all 22139 full 100% 0.06/s -[malloc debugging turned back on] diff --git a/GraphBLAS/Tcov/log_Jan9.txt b/GraphBLAS/Tcov/log_Jan9.txt new file mode 100644 index 0000000000..6cc3b2d621 --- /dev/null +++ b/GraphBLAS/Tcov/log_Jan9.txt @@ -0,0 +1,204 @@ + +---------------------------------------------- [malloc] [cover] +09-Jan 19:02:10 test250 1.4 sec 415: 24525 of 25102 2.3% 286.32/s +09-Jan 19:02:12 test250 2.1 sec 57: 24468 of 25102 2.5% 26.91/s +09-Jan 19:02:12 test279 0.1 sec 130: 24338 of 25102 3.0% 1120.05/s +09-Jan 19:02:12 test278 0.1 sec 49: 24289 of 25102 3.2% 518.63/s +09-Jan 19:02:12 test277 0.1 sec 38: 24251 of 25102 3.4% 412.87/s +09-Jan 19:02:13 test276 0.1 sec 1626: 22625 of 25102 9.9% 16727.71/s +09-Jan 19:02:13 test275 0.1 sec 117: 22508 of 25102 10.3% 1260.79/s +09-Jan 19:02:13 test274 0.1 sec 129: 22379 of 25102 10.8% 1407.42/s +09-Jan 19:02:13 test273 0.2 sec 110: 22269 of 25102 11.3% 479.04/s +09-Jan 19:02:13 test272 0.1 sec 11: 22258 of 25102 11.3% 117.72/s +09-Jan 19:02:13 test271 0.1 sec 497: 21761 of 25102 13.3% 5283.36/s +09-Jan 19:02:14 test270 0.1 sec 286: 21475 of 25102 14.4% 3084.52/s +09-Jan 19:02:14 test269 0.1 sec 87: 21388 of 25102 14.8% 927.38/s +09-Jan 19:02:14 test268 0.2 sec 102: 21286 of 25102 15.2% 441.67/s +09-Jan 19:02:17 test145 2.5 sec 221: 21065 of 25102 16.1% 88.45/s +09-Jan 19:02:17 test145 0.0 sec 1: 21064 of 25102 16.1% 20.22/s +09-Jan 19:02:17 test145 0.0 sec 18: 21046 of 25102 16.2% 818.74/s +09-Jan 19:02:17 test145 0.0 sec 4: 21042 of 25102 16.2% 225.43/s +09-Jan 19:02:18 test145 1.5 sec 34: 21008 of 25102 16.3% 22.38/s +09-Jan 19:02:18 test145 0.0 sec 3: 21005 of 25102 16.3% 178.81/s +09-Jan 19:02:20 test240 1.2 sec 80: 20922 of 25102 16.7% 68.04/s +09-Jan 19:02:20 test240 0.3 sec 1: 20921 of 25102 16.7% 3.39/s +09-Jan 19:02:22 test237 1.4 sec 42: 20879 of 25102 16.8% 29.50/s +09-Jan 19:02:25 test237 2.8 sec 2: 20877 of 25102 16.8% 0.70/s +09-Jan 19:02:25 test237 0.1 sec 18: 20859 of 25102 16.9% 174.87/s +09-Jan 19:02:25 test237 0.0 sec 6: 20853 of 25102 16.9% 219.04/s +09-Jan 19:02:25 test237 0.1 sec 4: 20849 of 25102 16.9% 46.63/s +09-Jan 19:02:26 test267 0.7 sec 8: 20841 of 25102 17.0% 11.91/s +09-Jan 19:02:26 test267 0.0 sec 1: 20840 of 25102 17.0% 1733.10/s +09-Jan 19:02:26 test265 0.5 sec 36: 20804 of 25102 17.1% 68.46/s +09-Jan 19:02:27 test264 0.1 sec 173: 20631 of 25102 17.8% 1794.94/s +09-Jan 19:02:27 test263 0.8 sec 16: 20615 of 25102 17.9% 19.09/s +09-Jan 19:02:28 test262 0.1 sec 76: 20539 of 25102 18.2% 736.18/s +09-Jan 19:02:28 test261 0.1 sec 22: 20517 of 25102 18.3% 238.46/s +09-Jan 19:02:28 test260 0.1 sec 3: 20514 of 25102 18.3% 33.11/s +09-Jan 19:02:31 test259 2.4 sec 4: 20510 of 25102 18.3% 1.64/s +09-Jan 19:02:31 test258 0.4 sec 20: 20490 of 25102 18.4% 55.72/s +09-Jan 19:02:32 test257 0.3 sec 54: 20436 of 25102 18.6% 187.42/s +09-Jan 19:02:32 test255 0.1 sec 8: 20428 of 25102 18.6% 76.72/s +09-Jan 19:02:32 test254 0.1 sec 29: 20399 of 25102 18.7% 365.91/s +09-Jan 19:02:37 test254 4.9 sec 20: 20379 of 25102 18.8% 4.12/s +09-Jan 19:02:37 test254 0.1 sec 1: 20378 of 25102 18.8% 10.57/s +09-Jan 19:02:37 test253 0.2 sec 8: 20370 of 25102 18.9% 38.22/s +09-Jan 19:02:38 test252 0.1 sec 7: 20363 of 25102 18.9% 78.65/s +09-Jan 19:04:00 test251 81.9 sec 472: 19891 of 25102 20.8% 5.76/s +09-Jan 19:07:30 test251 210.0 sec 76: 19815 of 25102 21.1% 0.36/s +09-Jan 19:07:31 test249 1.3 sec 27: 19788 of 25102 21.2% 20.92/s +09-Jan 19:07:32 test247 0.0 sec 24: 19764 of 25102 21.3% 1196.89/s +09-Jan 19:07:43 test246 11.0 sec 72: 19692 of 25102 21.6% 6.56/s +09-Jan 19:08:02 test01 18.8 sec 1420: 18272 of 25102 27.2% 75.59/s +09-Jan 19:08:03 test245 1.0 sec 34: 18238 of 25102 27.3% 34.16/s +09-Jan 19:08:03 test245 0.0 sec 8: 18230 of 25102 27.4% 216.93/s +09-Jan 19:08:03 test199 0.0 sec 1: 18229 of 25102 27.4% 153.73/s +09-Jan 19:08:03 test83 0.1 sec 15: 18214 of 25102 27.4% 159.22/s +09-Jan 19:08:03 test210 0.0 sec 9: 18205 of 25102 27.5% 2048.71/s +09-Jan 19:08:04 test165 0.0 sec 1: 18204 of 25102 27.5% 180.60/s +09-Jan 19:08:04 test219 0.1 sec 9: 18195 of 25102 27.5% 95.65/s +09-Jan 19:08:04 test219 0.3 sec 3: 18192 of 25102 27.5% 11.22/s +09-Jan 19:08:04 test241 0.1 sec 10: 18182 of 25102 27.6% 99.45/s +09-Jan 19:08:05 test220 0.1 sec 15: 18167 of 25102 27.6% 114.71/s +09-Jan 19:08:05 test211 0.0 sec 15: 18152 of 25102 27.7% 422.63/s +09-Jan 19:08:05 test202 0.1 sec 83: 18069 of 25102 28.0% 601.38/s +09-Jan 19:08:05 test202 0.0 sec 1: 18068 of 25102 28.0% 23.24/s +09-Jan 19:08:09 test152 3.0 sec 827: 17241 of 25102 31.3% 278.37/s +09-Jan 19:08:13 test152 4.1 sec 13: 17228 of 25102 31.4% 3.18/s +09-Jan 19:09:30 test152 76.7 sec 245: 16983 of 25102 32.3% 3.19/s +09-Jan 19:09:30 test222 0.2 sec 18: 16965 of 25102 32.4% 95.26/s +09-Jan 19:09:31 test256 0.7 sec 58: 16907 of 25102 32.6% 87.95/s +09-Jan 19:09:34 test186 2.9 sec 44: 16863 of 25102 32.8% 15.25/s +09-Jan 19:09:35 test186 0.5 sec 3: 16860 of 25102 32.8% 6.63/s +09-Jan 19:09:35 test186(0) 0.4 sec 5: 16855 of 25102 32.9% 12.37/s +09-Jan 19:09:36 test150 0.2 sec 44: 16811 of 25102 33.0% 212.26/s +09-Jan 19:09:36 test239 0.1 sec 15: 16796 of 25102 33.1% 117.90/s +09-Jan 19:09:37 test239 1.0 sec 2: 16794 of 25102 33.1% 2.10/s +09-Jan 19:09:38 test235 0.0 sec 4: 16790 of 25102 33.1% 96.59/s +09-Jan 19:09:38 test226 0.0 sec 8: 16782 of 25102 33.1% 568.87/s +09-Jan 19:09:38 test223 0.0 sec 2: 16780 of 25102 33.2% 61.10/s +09-Jan 19:09:38 test204 0.2 sec 14: 16766 of 25102 33.2% 77.02/s +09-Jan 19:09:39 test203 0.1 sec 19: 16747 of 25102 33.3% 203.20/s +09-Jan 19:09:39 test183 0.0 sec 12: 16735 of 25102 33.3% 417.67/s +09-Jan 19:09:39 test179 0.1 sec 15: 16720 of 25102 33.4% 103.52/s +09-Jan 19:09:41 test179 2.0 sec 4: 16716 of 25102 33.4% 2.05/s +09-Jan 19:09:42 test174 0.1 sec 10: 16706 of 25102 33.4% 195.47/s +09-Jan 19:09:42 test155 0.2 sec 43: 16663 of 25102 33.6% 278.84/s +09-Jan 19:09:43 test136 0.2 sec 57: 16606 of 25102 33.8% 253.63/s +09-Jan 19:09:44 test02 0.7 sec 247: 16359 of 25102 34.8% 333.30/s +09-Jan 19:09:44 test109 0.5 sec 10: 16349 of 25102 34.9% 20.75/s +09-Jan 19:09:45 test109 0.0 sec 4: 16345 of 25102 34.9% 1176.82/s +09-Jan 19:09:45 test109 0.4 sec 8: 16337 of 25102 34.9% 22.49/s +09-Jan 19:09:45 test04 0.1 sec 15: 16322 of 25102 35.0% 124.60/s +09-Jan 19:09:46 test207 0.0 sec 2: 16320 of 25102 35.0% 423.64/s +09-Jan 19:09:46 test221 0.0 sec 2: 16318 of 25102 35.0% 267.45/s +09-Jan 19:09:46 test162 0.1 sec 5: 16313 of 25102 35.0% 93.93/s +09-Jan 19:09:49 test159 2.5 sec 72: 16241 of 25102 35.3% 28.98/s +09-Jan 19:09:49 test09 0.0 sec 5: 16236 of 25102 35.3% 503.93/s +09-Jan 19:09:50 test132 0.1 sec 8: 16228 of 25102 35.4% 70.67/s +09-Jan 19:10:03 test141 12.7 sec 551: 15677 of 25102 37.5% 43.39/s +09-Jan 19:10:04 testc2(1,1) 1.4 sec 20: 15657 of 25102 37.6% 14.22/s +09-Jan 19:10:11 testc2(1,1) 6.6 sec 4: 15653 of 25102 37.6% 0.61/s +09-Jan 19:10:12 test214 0.0 sec 3: 15650 of 25102 37.7% 300.90/s +09-Jan 19:10:12 test213 0.0 sec 2: 15648 of 25102 37.7% 182.93/s +09-Jan 19:10:15 test206 2.5 sec 221: 15427 of 25102 38.5% 88.15/s +09-Jan 19:10:32 test206 16.9 sec 24: 15403 of 25102 38.6% 1.42/s +09-Jan 19:10:32 test212 0.0 sec 9: 15394 of 25102 38.7% 429.04/s +09-Jan 19:10:33 test212 0.2 sec 2: 15392 of 25102 38.7% 10.21/s +09-Jan 19:10:33 test128 0.3 sec 49: 15343 of 25102 38.9% 149.05/s +09-Jan 19:10:34 test82 0.1 sec 18: 15325 of 25102 38.9% 201.77/s +09-Jan 19:10:37 test229 3.1 sec 9: 15316 of 25102 39.0% 2.90/s +09-Jan 19:10:39 test229 1.1 sec 1: 15315 of 25102 39.0% 0.93/s +09-Jan 19:10:39 test144 0.6 sec 2: 15313 of 25102 39.0% 3.32/s +09-Jan 19:12:02 test14 82.0 sec 671: 14642 of 25102 41.7% 8.18/s +09-Jan 19:16:28 test14 265.8 sec 118: 14524 of 25102 42.1% 0.44/s +09-Jan 19:16:38 test180 8.7 sec 136: 14388 of 25102 42.7% 15.60/s +09-Jan 19:16:42 test236 3.6 sec 74: 14314 of 25102 43.0% 20.57/s +09-Jan 19:16:44 test232 2.6 sec 22: 14292 of 25102 43.1% 8.46/s +09-Jan 19:17:04 test228 19.0 sec 27: 14265 of 25102 43.2% 1.42/s +09-Jan 19:19:00 test154 115.8 sec 1502: 12763 of 25102 49.2% 12.97/s +09-Jan 19:25:17 test154 376.6 sec 2: 12761 of 25102 49.2% 0.01/s +09-Jan 19:25:31 test238 13.9 sec 54: 12707 of 25102 49.4% 3.88/s +09-Jan 19:26:41 test238 68.9 sec 9: 12698 of 25102 49.4% 0.13/s +09-Jan 19:28:21 test151b 99.9 sec 174: 12524 of 25102 50.1% 1.74/s +09-Jan 19:28:24 test184 3.1 sec 38: 12486 of 25102 50.3% 12.20/s +09-Jan 19:28:38 test191 12.7 sec 21: 12465 of 25102 50.3% 1.65/s +09-Jan 19:29:06 test191 28.4 sec 3: 12462 of 25102 50.4% 0.11/s +09-Jan 19:36:33 test188 445.8 sec 212: 12250 of 25102 51.2% 0.48/s +09-Jan 19:39:01 test188 147.5 sec 3: 12247 of 25102 51.2% 0.02/s +09-Jan 19:39:07 test224 5.0 sec 24: 12223 of 25102 51.3% 4.79/s +09-Jan 19:39:10 test196 2.4 sec 11: 12212 of 25102 51.4% 4.56/s +09-Jan 19:39:16 test209 6.2 sec 20: 12192 of 25102 51.4% 3.24/s +09-Jan 19:39:35 test104 18.4 sec 40: 12152 of 25102 51.6% 2.17/s +09-Jan 19:39:43 test189 7.9 sec 1: 12151 of 25102 51.6% 0.13/s +09-Jan 19:40:51 test194 67.5 sec 5: 12146 of 25102 51.6% 0.07/s +09-Jan 19:41:07 test76 15.4 sec 15: 12131 of 25102 51.7% 0.97/s +09-Jan 19:41:48 test244 39.9 sec 17: 12114 of 25102 51.7% 0.43/s +[malloc debugging turned off] +09-Jan 19:41:48 test201 0.0 sec 3: 12111 of 25102 51.8% 339.14/s +09-Jan 19:41:49 test225 0.1 sec 4: 12107 of 25102 51.8% 26.83/s +09-Jan 19:41:49 test176 0.1 sec 5: 12102 of 25102 51.8% 65.21/s +09-Jan 19:41:50 test208 0.0 sec 5: 12097 of 25102 51.8% 294.38/s +09-Jan 19:41:50 test216 0.1 sec 3: 12094 of 25102 51.8% 28.18/s +09-Jan 19:42:14 test142 23.8 sec 631: 11463 of 25102 54.3% 26.56/s +09-Jan 19:46:53 test142 278.2 sec 10: 11453 of 25102 54.4% 0.04/s +09-Jan 19:47:18 test142 23.9 sec 2: 11451 of 25102 54.4% 0.08/s +09-Jan 19:47:19 test137 0.4 sec 3: 11448 of 25102 54.4% 7.13/s +09-Jan 19:47:19 test137 0.0 sec 2: 11446 of 25102 54.4% 281.14/s +09-Jan 19:47:20 test139 0.4 sec 2: 11444 of 25102 54.4% 4.65/s +09-Jan 19:47:21 test172 0.1 sec 3: 11441 of 25102 54.4% 39.03/s +09-Jan 19:47:22 test148 0.9 sec 4: 11437 of 25102 54.4% 4.47/s +09-Jan 19:47:23 test157 0.6 sec 12: 11425 of 25102 54.5% 19.20/s +09-Jan 19:47:25 test182 1.0 sec 8: 11417 of 25102 54.5% 8.26/s +09-Jan 19:47:26 test108 0.6 sec 2: 11415 of 25102 54.5% 3.29/s +09-Jan 19:47:27 test108 0.4 sec 2: 11413 of 25102 54.5% 5.31/s +09-Jan 19:47:28 test130 0.9 sec 25: 11388 of 25102 54.6% 28.82/s +09-Jan 19:47:29 test124 0.2 sec 3: 11385 of 25102 54.6% 16.23/s +09-Jan 19:47:29 test138 0.1 sec 1: 11384 of 25102 54.6% 19.12/s +09-Jan 19:47:35 test227 4.6 sec 27: 11357 of 25102 54.8% 5.89/s +09-Jan 19:48:03 test125 28.1 sec 630: 10727 of 25102 57.3% 22.39/s +09-Jan 19:50:25 test234 141.5 sec 397: 10330 of 25102 58.8% 2.81/s +09-Jan 19:54:09 test234 222.8 sec 3: 10327 of 25102 58.9% 0.01/s +09-Jan 19:54:56 test242 46.1 sec 77: 10250 of 25102 59.2% 1.67/s +09-Jan 19:54:58 test173 1.5 sec 12: 10238 of 25102 59.2% 7.93/s +09-Jan 19:55:01 test200 3.2 sec 10: 10228 of 25102 59.3% 3.17/s +09-Jan 19:55:02 test197 0.2 sec 1: 10227 of 25102 59.3% 6.26/s +09-Jan 19:55:04 test84 1.3 sec 18: 10209 of 25102 59.3% 13.73/s +09-Jan 19:55:10 test19b 5.8 sec 59: 10150 of 25102 59.6% 10.09/s +09-Jan 19:55:11 test133 0.4 sec 2: 10148 of 25102 59.6% 4.77/s +09-Jan 19:55:16 test80 4.1 sec 12: 10136 of 25102 59.6% 2.93/s +09-Jan 19:56:20 test23 63.5 sec 148: 9988 of 25102 60.2% 2.33/s +09-Jan 19:56:23 test135 1.9 sec 7: 9981 of 25102 60.2% 3.69/s +09-Jan 19:57:36 test160 72.5 sec 24: 9957 of 25102 60.3% 0.33/s +09-Jan 19:57:42 test54 5.2 sec 20: 9937 of 25102 60.4% 3.87/s +09-Jan 19:57:43 test129 1.1 sec 4: 9933 of 25102 60.4% 3.50/s +09-Jan 19:57:46 test69 2.0 sec 6: 9927 of 25102 60.5% 2.95/s +09-Jan 19:59:15 test230 88.0 sec 114: 9813 of 25102 60.9% 1.30/s +09-Jan 20:31:54 test74 1958.2 sec 6637: 3176 of 25102 87.3% 3.39/s +09-Jan 20:43:55 test127 721.3 sec 1707: 1469 of 25102 94.1% 2.37/s +09-Jan 20:43:59 test19 3.2 sec 12: 1457 of 25102 94.2% 3.75/s +09-Jan 20:44:04 test11 3.7 sec 3: 1454 of 25102 94.2% 0.81/s +09-Jan 20:44:08 test215 3.2 sec 1: 1453 of 25102 94.2% 0.31/s +09-Jan 20:44:25 test193 16.6 sec 5: 1448 of 25102 94.2% 0.30/s +09-Jan 20:47:04 test195 158.6 sec 39: 1409 of 25102 94.4% 0.25/s +09-Jan 20:47:29 test243 23.9 sec 7: 1402 of 25102 94.4% 0.29/s +09-Jan 20:47:40 test29 10.6 sec 3: 1399 of 25102 94.4% 0.28/s +09-Jan 20:47:42 testc2(0,0) 1.3 sec 7: 1392 of 25102 94.5% 5.23/s +09-Jan 20:48:02 testc2(0,0) 19.6 sec 1: 1391 of 25102 94.5% 0.05/s +09-Jan 20:48:04 testc4(0) 0.6 sec 4: 1387 of 25102 94.5% 6.36/s +09-Jan 20:48:19 testc7(0) 14.5 sec 3: 1384 of 25102 94.5% 0.21/s +09-Jan 20:48:24 testcc(1) 5.0 sec 1: 1383 of 25102 94.5% 0.20/s +09-Jan 20:48:33 test187 8.2 sec 3: 1380 of 25102 94.5% 0.36/s +09-Jan 20:48:40 test192 5.6 sec 1: 1379 of 25102 94.5% 0.18/s +09-Jan 20:48:59 test181 18.2 sec 10: 1369 of 25102 94.5% 0.55/s +09-Jan 20:50:48 test185 109.1 sec 6: 1363 of 25102 94.6% 0.05/s +09-Jan 20:51:33 test53 43.6 sec 4: 1359 of 25102 94.6% 0.09/s +09-Jan 20:52:22 test17 48.6 sec 27: 1332 of 25102 94.7% 0.56/s +09-Jan 20:59:30 test231 427.7 sec 162: 1170 of 25102 95.3% 0.38/s +09-Jan 21:48:34 test10 2943.1 sec 970: 200 of 25102 99.2% 0.33/s +09-Jan 22:06:39 test75b 1058.8 sec 155: 45 of 25102 99.8% 0.15/s +09-Jan 22:08:08 test21b 87.4 sec 26: 19 of 25102 99.9% 0.30/s +09-Jan 22:09:00 testca(1) 51.4 sec 5: 14 of 25102 99.9% 0.10/s +09-Jan 22:10:54 test81 112.6 sec 1: 13 of 25102 99.9% 0.01/s +09-Jan 22:16:46 test18 351.2 sec 13: all 25102 full 100% 0.04/s +[malloc debugging turned back on] diff --git a/GraphBLAS/Test/GB_mex_dup.c b/GraphBLAS/Test/GB_mex_dup.c index f518d95610..ee51af00f2 100644 --- a/GraphBLAS/Test/GB_mex_dup.c +++ b/GraphBLAS/Test/GB_mex_dup.c @@ -10,6 +10,7 @@ // copy and typecast a matrix #include "GB_mex.h" +#include "GB_mex_errors.h" #define USAGE "C = GB_mex_dup (A, type, method, sparsity)" @@ -40,16 +41,11 @@ void mexFunction mexErrMsgTxt ("Usage: " USAGE) ; } - #define GET_DEEP_COPY ; + #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; - // get A (shallow copy) A = GB_mx_mxArray_to_Matrix (pargin [0], "A input", false, true) ; - if (A == NULL) - { - FREE_ALL ; - mexErrMsgTxt ("A failed") ; - } + GrB_Matrix_set_String (A, "A input", GrB_NAME) ; // get ctype of output matrix GrB_Type ctype = GB_mx_string_to_Type (PARGIN (1), A->type) ; @@ -66,6 +62,12 @@ void mexFunction if (method == 0 && sparsity == GxB_DEFAULT) { METHOD (GrB_Matrix_dup (&C, A)) ; + + // get the name of the C matrix + char name [256] ; + GrB_Matrix_get_String (C, name, GrB_NAME) ; + CHECK (MATCH (name, "A input")) ; + } else { diff --git a/GraphBLAS/Test/GB_mex_generic.h b/GraphBLAS/Test/GB_mex_generic.h index 31ffd1f08a..bcf017b62c 100644 --- a/GraphBLAS/Test/GB_mex_generic.h +++ b/GraphBLAS/Test/GB_mex_generic.h @@ -16,6 +16,147 @@ // testing the _Generic versions //------------------------------------------------------------------------------ +// GrB_get: +#define GrB_Scalar_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_Scalar_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_Scalar_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_Scalar_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_Scalar_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_Vector_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_Vector_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_Vector_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_Vector_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_Vector_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_Matrix_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_Matrix_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_Matrix_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_Matrix_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_Matrix_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GxB_Serialized_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GxB_Serialized_get_String_(...) GrB_get (__VA_ARGS__) +#define GxB_Serialized_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GxB_Serialized_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GxB_Serialized_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_UnaryOp_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_UnaryOp_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_UnaryOp_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_UnaryOp_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_UnaryOp_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_IndexUnaryOp_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_IndexUnaryOp_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_IndexUnaryOp_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_IndexUnaryOp_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_IndexUnaryOp_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_BinaryOp_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_BinaryOp_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_BinaryOp_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_BinaryOp_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_BinaryOp_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_Monoid_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_Monoid_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_Monoid_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_Monoid_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_Monoid_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_Semiring_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_Semiring_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_Semiring_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_Semiring_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_Semiring_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_Descriptor_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_Descriptor_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_Descriptor_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_Descriptor_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_Descriptor_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_Type_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_Type_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_Type_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_Type_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_Type_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GrB_Global_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GrB_Global_get_String_(...) GrB_get (__VA_ARGS__) +#define GrB_Global_get_INT32_(...) GrB_get (__VA_ARGS__) +#define GrB_Global_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GrB_Global_get_VOID_(...) GrB_get (__VA_ARGS__) + +#define GxB_Context_get_Scalar_(...) GrB_get (__VA_ARGS__) +#define GxB_Context_get_String_(...) GrB_get (__VA_ARGS__) +#define GxB_Context_get_INT_(...) GrB_get (__VA_ARGS__) +#define GxB_Context_get_SIZE_(...) GrB_get (__VA_ARGS__) +#define GxB_Context_get_VOID_(...) GrB_get (__VA_ARGS__) + +// GrB_set: + +#define GrB_Scalar_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_Scalar_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_Scalar_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_Scalar_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_Vector_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_Vector_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_Vector_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_Vector_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_Matrix_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_Matrix_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_Matrix_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_Matrix_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_UnaryOp_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_UnaryOp_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_UnaryOp_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_UnaryOp_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_IndexUnaryOp_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_IndexUnaryOp_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_IndexUnaryOp_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_IndexUnaryOp_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_BinaryOp_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_BinaryOp_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_BinaryOp_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_BinaryOp_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_Monoid_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_Monoid_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_Monoid_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_Monoid_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_Semiring_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_Semiring_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_Semiring_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_Semiring_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_Descriptor_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_Descriptor_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_Descriptor_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_Descriptor_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_Type_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_Type_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_Type_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_Type_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GrB_Global_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GrB_Global_set_String_(...) GrB_set (__VA_ARGS__) +#define GrB_Global_set_INT32_(...) GrB_set (__VA_ARGS__) +#define GrB_Global_set_VOID_(...) GrB_set (__VA_ARGS__) + +#define GxB_Context_set_Scalar_(...) GrB_set (__VA_ARGS__) +#define GxB_Context_set_String_(...) GrB_set (__VA_ARGS__) +#define GxB_Context_set_INT_(...) GrB_set (__VA_ARGS__) +#define GxB_Context_set_VOID_(...) GrB_set (__VA_ARGS__) + // GrB_free: #define GrB_Type_free_(...) GrB_free (__VA_ARGS__) #define GrB_UnaryOp_free_(...) GrB_free (__VA_ARGS__) @@ -592,6 +733,147 @@ // testing the non-polymorphic versions //------------------------------------------------------------------------------ +// GrB_get: +#define GrB_Scalar_get_Scalar_(...) GrB_Scalar_get_Scalar (__VA_ARGS__ ) +#define GrB_Scalar_get_String_(...) GrB_Scalar_get_String (__VA_ARGS__ ) +#define GrB_Scalar_get_INT32_(...) GrB_Scalar_get_INT32 (__VA_ARGS__ ) +#define GrB_Scalar_get_SIZE_(...) GrB_Scalar_get_SIZE (__VA_ARGS__ ) +#define GrB_Scalar_get_VOID_(...) GrB_Scalar_get_VOID (__VA_ARGS__ ) + +#define GrB_Vector_get_Scalar_(...) GrB_Vector_get_Scalar (__VA_ARGS__ ) +#define GrB_Vector_get_String_(...) GrB_Vector_get_String (__VA_ARGS__ ) +#define GrB_Vector_get_INT32_(...) GrB_Vector_get_INT32 (__VA_ARGS__ ) +#define GrB_Vector_get_SIZE_(...) GrB_Vector_get_SIZE (__VA_ARGS__ ) +#define GrB_Vector_get_VOID_(...) GrB_Vector_get_VOID (__VA_ARGS__ ) + +#define GrB_Matrix_get_Scalar_(...) GrB_Matrix_get_Scalar (__VA_ARGS__ ) +#define GrB_Matrix_get_String_(...) GrB_Matrix_get_String (__VA_ARGS__ ) +#define GrB_Matrix_get_INT32_(...) GrB_Matrix_get_INT32 (__VA_ARGS__ ) +#define GrB_Matrix_get_SIZE_(...) GrB_Matrix_get_SIZE (__VA_ARGS__ ) +#define GrB_Matrix_get_VOID_(...) GrB_Matrix_get_VOID (__VA_ARGS__ ) + +#define GxB_Serialized_get_Scalar_(...) GxB_Serialized_get_Scalar (__VA_ARGS__ ) +#define GxB_Serialized_get_String_(...) GxB_Serialized_get_String (__VA_ARGS__ ) +#define GxB_Serialized_get_INT32_(...) GxB_Serialized_get_INT32 (__VA_ARGS__ ) +#define GxB_Serialized_get_SIZE_(...) GxB_Serialized_get_SIZE (__VA_ARGS__ ) +#define GxB_Serialized_get_VOID_(...) GxB_Serialized_get_VOID (__VA_ARGS__ ) + +#define GrB_UnaryOp_get_Scalar_(...) GrB_UnaryOp_get_Scalar (__VA_ARGS__ ) +#define GrB_UnaryOp_get_String_(...) GrB_UnaryOp_get_String (__VA_ARGS__ ) +#define GrB_UnaryOp_get_INT32_(...) GrB_UnaryOp_get_INT32 (__VA_ARGS__ ) +#define GrB_UnaryOp_get_SIZE_(...) GrB_UnaryOp_get_SIZE (__VA_ARGS__ ) +#define GrB_UnaryOp_get_VOID_(...) GrB_UnaryOp_get_VOID (__VA_ARGS__ ) + +#define GrB_IndexUnaryOp_get_Scalar_(...) GrB_IndexUnaryOp_get_Scalar (__VA_ARGS__ ) +#define GrB_IndexUnaryOp_get_String_(...) GrB_IndexUnaryOp_get_String (__VA_ARGS__ ) +#define GrB_IndexUnaryOp_get_INT32_(...) GrB_IndexUnaryOp_get_INT32 (__VA_ARGS__ ) +#define GrB_IndexUnaryOp_get_SIZE_(...) GrB_IndexUnaryOp_get_SIZE (__VA_ARGS__ ) +#define GrB_IndexUnaryOp_get_VOID_(...) GrB_IndexUnaryOp_get_VOID (__VA_ARGS__ ) + +#define GrB_BinaryOp_get_Scalar_(...) GrB_BinaryOp_get_Scalar (__VA_ARGS__ ) +#define GrB_BinaryOp_get_String_(...) GrB_BinaryOp_get_String (__VA_ARGS__ ) +#define GrB_BinaryOp_get_INT32_(...) GrB_BinaryOp_get_INT32 (__VA_ARGS__ ) +#define GrB_BinaryOp_get_SIZE_(...) GrB_BinaryOp_get_SIZE (__VA_ARGS__ ) +#define GrB_BinaryOp_get_VOID_(...) GrB_BinaryOp_get_VOID (__VA_ARGS__ ) + +#define GrB_Monoid_get_Scalar_(...) GrB_Monoid_get_Scalar (__VA_ARGS__ ) +#define GrB_Monoid_get_String_(...) GrB_Monoid_get_String (__VA_ARGS__ ) +#define GrB_Monoid_get_INT32_(...) GrB_Monoid_get_INT32 (__VA_ARGS__ ) +#define GrB_Monoid_get_SIZE_(...) GrB_Monoid_get_SIZE (__VA_ARGS__ ) +#define GrB_Monoid_get_VOID_(...) GrB_Monoid_get_VOID (__VA_ARGS__ ) + +#define GrB_Semiring_get_Scalar_(...) GrB_Semiring_get_Scalar (__VA_ARGS__ ) +#define GrB_Semiring_get_String_(...) GrB_Semiring_get_String (__VA_ARGS__ ) +#define GrB_Semiring_get_INT32_(...) GrB_Semiring_get_INT32 (__VA_ARGS__ ) +#define GrB_Semiring_get_SIZE_(...) GrB_Semiring_get_SIZE (__VA_ARGS__ ) +#define GrB_Semiring_get_VOID_(...) GrB_Semiring_get_VOID (__VA_ARGS__ ) + +#define GrB_Descriptor_get_Scalar_(...) GrB_Descriptor_get_Scalar (__VA_ARGS__ ) +#define GrB_Descriptor_get_String_(...) GrB_Descriptor_get_String (__VA_ARGS__ ) +#define GrB_Descriptor_get_INT32_(...) GrB_Descriptor_get_INT32 (__VA_ARGS__ ) +#define GrB_Descriptor_get_SIZE_(...) GrB_Descriptor_get_SIZE (__VA_ARGS__ ) +#define GrB_Descriptor_get_VOID_(...) GrB_Descriptor_get_VOID (__VA_ARGS__ ) + +#define GrB_Type_get_Scalar_(...) GrB_Type_get_Scalar (__VA_ARGS__ ) +#define GrB_Type_get_String_(...) GrB_Type_get_String (__VA_ARGS__ ) +#define GrB_Type_get_INT32_(...) GrB_Type_get_INT32 (__VA_ARGS__ ) +#define GrB_Type_get_SIZE_(...) GrB_Type_get_SIZE (__VA_ARGS__ ) +#define GrB_Type_get_VOID_(...) GrB_Type_get_VOID (__VA_ARGS__ ) + +#define GrB_Global_get_Scalar_(...) GrB_Global_get_Scalar (__VA_ARGS__ ) +#define GrB_Global_get_String_(...) GrB_Global_get_String (__VA_ARGS__ ) +#define GrB_Global_get_INT32_(...) GrB_Global_get_INT32 (__VA_ARGS__ ) +#define GrB_Global_get_SIZE_(...) GrB_Global_get_SIZE (__VA_ARGS__ ) +#define GrB_Global_get_VOID_(...) GrB_Global_get_VOID (__VA_ARGS__ ) + +#define GxB_Context_get_Scalar_(...) GxB_Context_get_Scalar (__VA_ARGS__ ) +#define GxB_Context_get_String_(...) GxB_Context_get_String (__VA_ARGS__ ) +#define GxB_Context_get_INT_(...) GxB_Context_get_INT (__VA_ARGS__ ) +#define GxB_Context_get_SIZE_(...) GxB_Context_get_SIZE (__VA_ARGS__ ) +#define GxB_Context_get_VOID_(...) GxB_Context_get_VOID (__VA_ARGS__ ) + +// GrB_set: + +#define GrB_Scalar_set_Scalar_(...) GrB_Scalar_set_Scalar (__VA_ARGS__ ) +#define GrB_Scalar_set_String_(...) GrB_Scalar_set_String (__VA_ARGS__ ) +#define GrB_Scalar_set_INT32_(...) GrB_Scalar_set_INT32 (__VA_ARGS__ ) +#define GrB_Scalar_set_VOID_(...) GrB_Scalar_set_VOID (__VA_ARGS__ ) + +#define GrB_Vector_set_Scalar_(...) GrB_Vector_set_Scalar (__VA_ARGS__ ) +#define GrB_Vector_set_String_(...) GrB_Vector_set_String (__VA_ARGS__ ) +#define GrB_Vector_set_INT32_(...) GrB_Vector_set_INT32 (__VA_ARGS__ ) +#define GrB_Vector_set_VOID_(...) GrB_Vector_set_VOID (__VA_ARGS__ ) + +#define GrB_Matrix_set_Scalar_(...) GrB_Matrix_set_Scalar (__VA_ARGS__ ) +#define GrB_Matrix_set_String_(...) GrB_Matrix_set_String (__VA_ARGS__ ) +#define GrB_Matrix_set_INT32_(...) GrB_Matrix_set_INT32 (__VA_ARGS__ ) +#define GrB_Matrix_set_VOID_(...) GrB_Matrix_set_VOID (__VA_ARGS__ ) + +#define GrB_UnaryOp_set_Scalar_(...) GrB_UnaryOp_set_Scalar (__VA_ARGS__ ) +#define GrB_UnaryOp_set_String_(...) GrB_UnaryOp_set_String (__VA_ARGS__ ) +#define GrB_UnaryOp_set_INT32_(...) GrB_UnaryOp_set_INT32 (__VA_ARGS__ ) +#define GrB_UnaryOp_set_VOID_(...) GrB_UnaryOp_set_VOID (__VA_ARGS__ ) + +#define GrB_IndexUnaryOp_set_Scalar_(...) GrB_IndexUnaryOp_set_Scalar (__VA_ARGS__ ) +#define GrB_IndexUnaryOp_set_String_(...) GrB_IndexUnaryOp_set_String (__VA_ARGS__ ) +#define GrB_IndexUnaryOp_set_INT32_(...) GrB_IndexUnaryOp_set_INT32 (__VA_ARGS__ ) +#define GrB_IndexUnaryOp_set_VOID_(...) GrB_IndexUnaryOp_set_VOID (__VA_ARGS__ ) + +#define GrB_BinaryOp_set_Scalar_(...) GrB_BinaryOp_set_Scalar (__VA_ARGS__ ) +#define GrB_BinaryOp_set_String_(...) GrB_BinaryOp_set_String (__VA_ARGS__ ) +#define GrB_BinaryOp_set_INT32_(...) GrB_BinaryOp_set_INT32 (__VA_ARGS__ ) +#define GrB_BinaryOp_set_VOID_(...) GrB_BinaryOp_set_VOID (__VA_ARGS__ ) + +#define GrB_Monoid_set_Scalar_(...) GrB_Monoid_set_Scalar (__VA_ARGS__ ) +#define GrB_Monoid_set_String_(...) GrB_Monoid_set_String (__VA_ARGS__ ) +#define GrB_Monoid_set_INT32_(...) GrB_Monoid_set_INT32 (__VA_ARGS__ ) +#define GrB_Monoid_set_VOID_(...) GrB_Monoid_set_VOID (__VA_ARGS__ ) + +#define GrB_Semiring_set_Scalar_(...) GrB_Semiring_set_Scalar (__VA_ARGS__ ) +#define GrB_Semiring_set_String_(...) GrB_Semiring_set_String (__VA_ARGS__ ) +#define GrB_Semiring_set_INT32_(...) GrB_Semiring_set_INT32 (__VA_ARGS__ ) +#define GrB_Semiring_set_VOID_(...) GrB_Semiring_set_VOID (__VA_ARGS__ ) + +#define GrB_Descriptor_set_Scalar_(...) GrB_Descriptor_set_Scalar (__VA_ARGS__ ) +#define GrB_Descriptor_set_String_(...) GrB_Descriptor_set_String (__VA_ARGS__ ) +#define GrB_Descriptor_set_INT32_(...) GrB_Descriptor_set_INT32 (__VA_ARGS__ ) +#define GrB_Descriptor_set_VOID_(...) GrB_Descriptor_set_VOID (__VA_ARGS__ ) + +#define GrB_Type_set_Scalar_(...) GrB_Type_set_Scalar (__VA_ARGS__ ) +#define GrB_Type_set_String_(...) GrB_Type_set_String (__VA_ARGS__ ) +#define GrB_Type_set_INT32_(...) GrB_Type_set_INT32 (__VA_ARGS__ ) +#define GrB_Type_set_VOID_(...) GrB_Type_set_VOID (__VA_ARGS__ ) + +#define GrB_Global_set_Scalar_(...) GrB_Global_set_Scalar (__VA_ARGS__ ) +#define GrB_Global_set_String_(...) GrB_Global_set_String (__VA_ARGS__ ) +#define GrB_Global_set_INT32_(...) GrB_Global_set_INT32 (__VA_ARGS__ ) +#define GrB_Global_set_VOID_(...) GrB_Global_set_VOID (__VA_ARGS__ ) + +#define GxB_Context_set_Scalar_(...) GxB_Context_set_Scalar (__VA_ARGS__ ) +#define GxB_Context_set_String_(...) GxB_Context_set_String (__VA_ARGS__ ) +#define GxB_Context_set_INT_(...) GxB_Context_set_INT (__VA_ARGS__ ) +#define GxB_Context_set_VOID_(...) GxB_Context_set_VOID (__VA_ARGS__ ) + // GrB_free: #define GrB_Type_free_(...) GrB_Type_free (__VA_ARGS__) #define GrB_UnaryOp_free_(...) GrB_UnaryOp_free (__VA_ARGS__) diff --git a/GraphBLAS/Test/GB_mex_serialize.c b/GraphBLAS/Test/GB_mex_serialize.c index c12dc9f68e..ca30a0cfec 100644 --- a/GraphBLAS/Test/GB_mex_serialize.c +++ b/GraphBLAS/Test/GB_mex_serialize.c @@ -19,7 +19,7 @@ // method: // -2 // GrB*serialize with default LZ4 compression // GxB_COMPRESSION_NONE -1 // no compression -// GxB_COMPRESSION_DEFAULT 0 // LZ4 +// GxB_COMPRESSION_DEFAULT 0 // ZSTD level 1 // GxB_COMPRESSION_LZ4 1000 // LZ4 // GxB_COMPRESSION_LZ4HC 2000 // LZ4HC, with default level 9 // GxB_COMPRESSION_LZ4HC 2001 // LZ4HC:1 diff --git a/GraphBLAS/Test/GB_mex_test0.c b/GraphBLAS/Test/GB_mex_test0.c index d0f258cb6a..c0fcb37635 100644 --- a/GraphBLAS/Test/GB_mex_test0.c +++ b/GraphBLAS/Test/GB_mex_test0.c @@ -3868,10 +3868,7 @@ void mexFunction ERR (GB_Type_check (Tcrud, "Tcrud", G1, ff)) ; CHECK (T == NULL) ; - // test the function instead of the macro: - #undef GrB_Type_new - #undef GrM_Type_new - OK (GRB (Type_new) (&T, sizeof (int))) ; + OK (GrB_Type_new (&T, sizeof (int))) ; Werk->where = "GB_Type_check" ; OK (GB_Type_check (T, "T ok (via function)", G3, ff)) ; @@ -3913,10 +3910,7 @@ void mexFunction CHECK (info == GrB_NULL_POINTER) ; CHECK (op1b == NULL) ; - // test the function instead of the macro: - #undef GrB_UnaryOp_new - #undef GrM_UnaryOp_new - OK (GRB (UnaryOp_new) (&op1b, (GxB_unary_function) f1, GrB_FP64, GrB_UINT32)) ; + OK (GrB_UnaryOp_new (&op1b, (GxB_unary_function) f1, GrB_FP64, GrB_UINT32)) ; CHECK (op1b != NULL) ; OK (GrB_UnaryOp_wait_(op1b, GrB_MATERIALIZE)) ; @@ -3961,10 +3955,7 @@ void mexFunction CHECK (info == GrB_NULL_POINTER) ; CHECK (op2b == NULL) ; - // test the function instead of the macro: - #undef GrB_BinaryOp_new - #undef GrM_BinaryOp_new - OK (GRB (BinaryOp_new) (&op2b, (GxB_binary_function) f2, GrB_INT32, GrB_UINT8, GrB_INT16)) ; + OK (GrB_BinaryOp_new (&op2b, (GxB_binary_function) f2, GrB_INT32, GrB_UINT8, GrB_INT16)) ; CHECK (op2b != NULL) ; Werk->where = "GB_BinaryOp_check" ; @@ -4000,54 +3991,6 @@ void mexFunction printf ("\nAll GB_BinaryOp_check tests passed (errors expected)\n") ; - //-------------------------------------------------------------------------- - // SelectOp check - //-------------------------------------------------------------------------- - -#if 0 - printf ("\n-------------- GB_SelectOp_check:\n") ; - - Werk->where = "GB_SelectOp_check" ; - - info = GB_SelectOp_check (NULL, "null selectop", G3, ff) ; - CHECK (info == GrB_NULL_POINTER) ; - - CHECK (selectop == NULL) ; - // test the function instead of the macro: - #undef GxB_SelectOp_new - #undef GxM_SelectOp_new - OK (GXB (SelectOp_new) (&selectop, (GxB_select_function) fselect, GrB_FP64, GrB_FP64)) ; - CHECK (selectop != NULL) ; - - Werk->where = "GB_SelectOp_check" ; - OK (GB_SelectOp_check (selectop, "user selectop ok (via function)", G3, - ff)) ; - - expected = GrB_UNINITIALIZED_OBJECT ; - - selectop->magic = GB_FREED ; - ERR (GB_SelectOp_check (selectop, "selectop freed", G1, ff)) ; - selectop->magic = GB_MAGIC ; - - expected = GrB_INVALID_OBJECT ; - - selectop->selop_function = NULL ; - ERR (GB_SelectOp_check (selectop, "selectop invalid function", G1, ff)) ; - selectop->selop_function = (GxB_select_function) fselect ; - - selectop->opcode = 9999 ; - ERR (GB_SelectOp_check (selectop, "selectop invalid opcode", G1, ff)) ; - selectop->opcode = GB_USER_selop_code ; - - selectop->xtype = Tcrud ; - ERR (GB_SelectOp_check (selectop, "selectop invalid xtype", G1, ff)) ; - selectop->xtype = GrB_FP64 ; - - OK (GB_SelectOp_check (selectop, "user selectop ok", G3, ff)) ; - - printf ("\nAll GB_SelectOp_check tests passed (errors expected)\n") ; -#endif - //-------------------------------------------------------------------------- // Monoid check //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_mex_test1.c b/GraphBLAS/Test/GB_mex_test1.c index 0423432732..44d943e043 100644 --- a/GraphBLAS/Test/GB_mex_test1.c +++ b/GraphBLAS/Test/GB_mex_test1.c @@ -84,12 +84,16 @@ void mexFunction sizeof (struct GB_Monoid_opaque)) ; printf ("sizeof (struct GB_Semiring_opaque) %d\n", sizeof (struct GB_Semiring_opaque)) ; + printf ("sizeof (struct GB_Scalar_opaque) %d\n", + sizeof (struct GB_Scalar_opaque)) ; printf ("sizeof (struct GB_Vector_opaque) %d\n", sizeof (struct GB_Vector_opaque)) ; printf ("sizeof (struct GB_Matrix_opaque) %d\n", sizeof (struct GB_Matrix_opaque)) ; printf ("sizeof (struct GB_Descriptor_opaque) %d\n", sizeof (struct GB_Descriptor_opaque)) ; + printf ("sizeof (struct GB_Context_opaque) %d\n", + sizeof (struct GB_Context_opaque)) ; size_t s ; GxB_Type_size (&s, GrB_BOOL ) ; printf ("%d %d\n", s, sizeof (bool )); diff --git a/GraphBLAS/Test/GB_mex_test11.c b/GraphBLAS/Test/GB_mex_test11.c index a731a0402c..6ee30630ae 100644 --- a/GraphBLAS/Test/GB_mex_test11.c +++ b/GraphBLAS/Test/GB_mex_test11.c @@ -489,7 +489,7 @@ if (jit_enabled) OK (GxB_Context_engage (context1)) ; expected = GrB_INVALID_VALUE ; ERR (GxB_Context_disengage (context2)) ; - OK (GxB_Context_set (context1, GxB_CHUNK, -1)) ; + OK (GxB_Context_set (context1, GxB_CHUNK, (double) -1)) ; double chunk = 0 ; OK (GxB_Context_get (context1, GxB_CHUNK, &chunk)) ; CHECK (chunk == GB_CHUNK_DEFAULT) ; diff --git a/GraphBLAS/Test/GB_mex_test25.c b/GraphBLAS/Test/GB_mex_test25.c index 7dbfa16e21..ab9ad206fd 100644 --- a/GraphBLAS/Test/GB_mex_test25.c +++ b/GraphBLAS/Test/GB_mex_test25.c @@ -9,6 +9,7 @@ #include "GB_mex.h" #include "GB_mex_errors.h" +#include "GB_get_set.h" #define USAGE "GB_mex_test25" @@ -72,6 +73,35 @@ void mexFunction printf ("GxB_Context_error [%s] ok\n", s) ; OK (GxB_Context_wait (GxB_CONTEXT_WORLD, GrB_COMPLETE)) ; + //-------------------------------------------------------------------------- + // report object sizes + //-------------------------------------------------------------------------- + + printf ("%4d: sizeof (struct GB_Type_opaque)\n", + (int) sizeof (struct GB_Type_opaque)) ; + printf ("%4d: sizeof (struct GB_UnaryOp_opaque)\n", + (int) sizeof (struct GB_UnaryOp_opaque)) ; + printf ("%4d: sizeof (struct GB_BinaryOp_opaque)\n", + (int) sizeof (struct GB_BinaryOp_opaque)) ; + printf ("%4d: sizeof (struct GB_SelectOp_opaque)\n", + (int) sizeof (struct GB_SelectOp_opaque)) ; + printf ("%4d: sizeof (struct GB_Monoid_opaque)\n", + (int) sizeof (struct GB_Monoid_opaque)) ; + printf ("%4d: sizeof (struct GB_Semiring_opaque)\n", + (int) sizeof (struct GB_Semiring_opaque)) ; + printf ("%4d: sizeof (struct GB_Scalar_opaque)\n", + (int) sizeof (struct GB_Scalar_opaque)) ; + printf ("%4d: sizeof (struct GB_Vector_opaque)\n", + (int) sizeof (struct GB_Vector_opaque)) ; + printf ("%4d: sizeof (struct GB_Matrix_opaque)\n", + (int) sizeof (struct GB_Matrix_opaque)) ; + printf ("%4d: sizeof (struct GB_Descriptor_opaque)\n", + (int) sizeof (struct GB_Descriptor_opaque)) ; + printf ("%4d: sizeof (struct GB_Context_opaque)\n", + (int) sizeof (struct GB_Context_opaque)) ; + printf ("%4d: sizeof (struct GB_Global_opaque)\n", + (int) sizeof (struct GB_Global_opaque)) ; + //-------------------------------------------------------------------------- // finalize GraphBLAS //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_mex_test26.c b/GraphBLAS/Test/GB_mex_test26.c new file mode 100644 index 0000000000..f85142470d --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test26.c @@ -0,0 +1,674 @@ +//------------------------------------------------------------------------------ +// GB_mex_test26: test GrB_get and GrB_set (type, scalar, vector, matrix) +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test26" + +#define FREE_ALL ; +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +typedef struct { int32_t stuff ; } mytype ; +#define MYTYPE_DEFN \ +"typedef struct { int32_t stuff ; } mytype ;" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix A = NULL ; + GrB_Vector v = NULL ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL, + s_uint64 = NULL ; + GrB_Type type = NULL ; + uint64_t u64 ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size ; + char name [256] ; + char defn [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + OK (GrB_Scalar_new (&s_uint64, GrB_UINT64)) ; + + //-------------------------------------------------------------------------- + // GrB_Type get/set + //-------------------------------------------------------------------------- + + // type name size + OK (GrB_Type_get_SIZE_(GrB_BOOL, &size, GrB_NAME)) ; + CHECK (size == strlen ("GrB_BOOL") + 1) ; + + OK (GrB_Type_get_SIZE_(GrB_BOOL, &size, GxB_JIT_C_NAME)) ; + CHECK (size == strlen ("bool") + 1) ; + + // type name + OK (GrB_Type_get_String_(GrB_BOOL, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_BOOL")) ; + + OK (GrB_Type_get_String_(GrB_INT8, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_INT8")) ; + + OK (GrB_Type_get_String_(GrB_INT16, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_INT16")) ; + + OK (GrB_Type_get_String_(GrB_INT32, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_INT32")) ; + + OK (GrB_Type_get_String_(GrB_INT64, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_INT64")) ; + + OK (GrB_Type_get_String_(GrB_UINT8, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_UINT8")) ; + + OK (GrB_Type_get_String_(GrB_UINT16, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_UINT16")) ; + + OK (GrB_Type_get_String_(GrB_UINT32, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_UINT32")) ; + + OK (GrB_Type_get_String_(GrB_UINT64, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_UINT64")) ; + + OK (GrB_Type_get_String_(GrB_FP32, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_Type_get_String_(GrB_FP64, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_FP64")) ; + + OK (GrB_Type_get_String_(GxB_FC32, name, GrB_NAME)) ; + CHECK (MATCH (name, "GxB_FC32")) ; + + OK (GrB_Type_get_String_(GxB_FC64, name, GrB_NAME)) ; + CHECK (MATCH (name, "GxB_FC64")) ; + + // type JIT name + OK (GrB_Type_get_String_(GrB_BOOL, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "bool")) ; + + OK (GrB_Type_get_String_(GrB_INT8, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "int8_t")) ; + + OK (GrB_Type_get_String_(GrB_INT16, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "int16_t")) ; + + OK (GrB_Type_get_String_(GrB_INT32, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "int32_t")) ; + + OK (GrB_Type_get_String_(GrB_INT64, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "int64_t")) ; + + OK (GrB_Type_get_String_(GrB_UINT8, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "uint8_t")) ; + + OK (GrB_Type_get_String_(GrB_UINT16, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "uint16_t")) ; + + OK (GrB_Type_get_String_(GrB_UINT32, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "uint32_t")) ; + + OK (GrB_Type_get_String_(GrB_UINT64, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "uint64_t")) ; + + OK (GrB_Type_get_String_(GrB_FP32, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "float")) ; + + OK (GrB_Type_get_String_(GrB_FP64, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "double")) ; + + OK (GrB_Type_get_String_(GxB_FC32, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "GxB_FC32_t")) ; + + OK (GrB_Type_get_String_(GxB_FC64, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "GxB_FC64_t")) ; + + // type code + OK (GrB_Type_get_INT32_(GrB_BOOL, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_BOOL_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_INT8, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_INT8_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_INT16, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_INT16_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_INT32, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_INT32_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_INT64, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_INT64_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_UINT8, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_UINT8_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_UINT16, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_UINT16_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_UINT32, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_UINT32_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_UINT64, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_UINT64_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_FP32, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_Type_get_INT32_(GrB_FP64, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_FP64_CODE) ; + + OK (GrB_Type_get_INT32_(GxB_FC32, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GxB_FC32_CODE) ; + + OK (GrB_Type_get_INT32_(GxB_FC64, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GxB_FC64_CODE) ; + + // type size (using a GrB_Scalar): recommended type of GrB_UINT64 + OK (GrB_Type_get_Scalar_(GrB_BOOL, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (bool)) ; + + OK (GrB_Type_get_Scalar_(GrB_INT8, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (int8_t)) ; + + OK (GrB_Type_get_Scalar_(GrB_INT16, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (int16_t)) ; + + OK (GrB_Type_get_Scalar_(GrB_INT32, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (int32_t)) ; + + OK (GrB_Type_get_Scalar_(GrB_INT64, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (int64_t)) ; + + OK (GrB_Type_get_Scalar_(GrB_UINT8, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (uint8_t)) ; + + OK (GrB_Type_get_Scalar_(GrB_UINT16, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (uint16_t)) ; + + OK (GrB_Type_get_Scalar_(GrB_UINT32, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (uint32_t)) ; + + OK (GrB_Type_get_Scalar_(GrB_UINT64, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (uint64_t)) ; + + OK (GrB_Type_get_Scalar_(GrB_FP32, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (float)) ; + + OK (GrB_Type_get_Scalar_(GrB_FP64, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (double)) ; + + OK (GrB_Type_get_Scalar_(GxB_FC32, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (float complex)) ; + + OK (GrB_Type_get_Scalar_(GxB_FC64, s_uint64, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_UINT64_(&u64, s_uint64)) ; + CHECK (u64 == sizeof (double complex)) ; + + + // type size (using a size_t) + size = 0 ; + OK (GrB_Type_get_SIZE_(GrB_BOOL, &size, GrB_SIZE)) ; + CHECK (size == sizeof (bool)) ; + + OK (GrB_Type_get_SIZE_(GrB_INT8, &size, GrB_SIZE)) ; + CHECK (size == sizeof (int8_t)) ; + + OK (GrB_Type_get_SIZE_(GrB_INT16, &size, GrB_SIZE)) ; + CHECK (size == sizeof (int16_t)) ; + + OK (GrB_Type_get_SIZE_(GrB_INT32, &size, GrB_SIZE)) ; + CHECK (size == sizeof (int32_t)) ; + + OK (GrB_Type_get_SIZE_(GrB_INT64, &size, GrB_SIZE)) ; + CHECK (size == sizeof (int64_t)) ; + + OK (GrB_Type_get_SIZE_(GrB_UINT8, &size, GrB_SIZE)) ; + CHECK (size == sizeof (uint8_t)) ; + + OK (GrB_Type_get_SIZE_(GrB_UINT16, &size, GrB_SIZE)) ; + CHECK (size == sizeof (uint16_t)) ; + + OK (GrB_Type_get_SIZE_(GrB_UINT32, &size, GrB_SIZE)) ; + CHECK (size == sizeof (uint32_t)) ; + + OK (GrB_Type_get_SIZE_(GrB_UINT64, &size, GrB_SIZE)) ; + CHECK (size == sizeof (uint64_t)) ; + + OK (GrB_Type_get_SIZE_(GrB_FP32, &size, GrB_SIZE)) ; + CHECK (size == sizeof (float)) ; + + OK (GrB_Type_get_SIZE_(GrB_FP64, &size, GrB_SIZE)) ; + CHECK (size == sizeof (double)) ; + + OK (GrB_Type_get_SIZE_(GxB_FC32, &size, GrB_SIZE)) ; + CHECK (size == sizeof (float complex)) ; + + OK (GrB_Type_get_SIZE_(GxB_FC64, &size, GrB_SIZE)) ; + CHECK (size == sizeof (double complex)) ; + + + + // built-in type definition + OK (GrB_Type_get_SIZE_(GrB_BOOL, &size, GxB_JIT_C_DEFINITION)) ; + CHECK (size == 1) ; + OK (GrB_Type_get_String_(GrB_BOOL, defn, GxB_JIT_C_DEFINITION)) ; + CHECK (MATCH (defn, "")) ; + + // user-defined type + OK (GrB_Type_new (&type, sizeof (mytype))) ; + OK (GxB_print (type, 3)) ; + expected = GrB_INVALID_VALUE ; + ERR (GrB_Type_set_String_(type, "", GxB_JIT_C_NAME)) ; + OK (GrB_Type_set_String_(type, "mytype", GxB_JIT_C_NAME)) ; + CHECK (type->hash == UINT64_MAX) ; + OK (GrB_Type_set_String_(type, MYTYPE_DEFN, GxB_JIT_C_DEFINITION)) ; + OK (GxB_print (type, 3)) ; + CHECK (type->hash != UINT64_MAX) ; + printf (" hash: %016lx\n", type->hash) ; + + OK (GrB_Type_get_SIZE_(type, &size, GrB_NAME)) ; + CHECK (size == 1) ; + OK (GrB_Type_set_String_ (type, "user name of a type", GrB_NAME)) ; + OK (GrB_Type_get_SIZE_(type, &size, GrB_NAME)) ; + CHECK (size == strlen ("user name of a type") + 1) ; + OK (GrB_Type_get_String_ (type, name, GrB_NAME)) ; + CHECK (MATCH (name, "user name of a type")) ; + + expected = GrB_ALREADY_SET ; + ERR (GrB_Type_set_String_ (type, "another user name of a type", GrB_NAME)) ; + printf (" test GrB_ALREADY_SET: ok\n") ; + + OK (GrB_Type_get_String_(type, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "mytype")) ; + OK (GrB_Type_get_SIZE_(type, &size, GxB_JIT_C_NAME)) ; + CHECK (size == strlen ("mytype") + 1) ; + + OK (GrB_Type_get_SIZE_(type, &size, GxB_JIT_C_DEFINITION)) ; + CHECK (size == strlen (MYTYPE_DEFN) + 1) ; + OK (GrB_Type_get_String_(type, defn, GxB_JIT_C_DEFINITION)) ; + CHECK (MATCH (defn, MYTYPE_DEFN)) ; + + OK (GrB_Type_get_Scalar_(type, s_int32, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; + CHECK (i == sizeof (mytype)) ; + + OK (GrB_Type_get_INT32_(type, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_UDT_CODE) ; + + OK (GrB_Type_get_String_(type, name, GrB_EL_TYPE_STRING)) ; + CHECK (MATCH (name, "user name of a type")) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Type_get_INT32_(type, &code, GrB_EL_TYPE_STRING)) ; + + i = -1 ; + OK (GrB_Type_get_Scalar_(type, s_int32, GrB_EL_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; + CHECK (i == GrB_UDT_CODE) ; + + OK (GrB_Type_get_Scalar_(type, s_int32, GrB_SIZE)) ; + OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; + CHECK (i == sizeof (mytype)) ; + + expected = GrB_INVALID_VALUE ; + 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)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Type_get_VOID_(type, nothing, 0)) ; + ERR (GrB_Type_set_Scalar_(type, s_int32, 0)) ; + ERR (GrB_Type_set_INT32_(type, 3, 0)) ; + ERR (GrB_Type_set_VOID_(type, nothing, 0, 256)) ; + + //-------------------------------------------------------------------------- + // GrB_Scalar get/set + //-------------------------------------------------------------------------- + + OK (GrB_Scalar_new (&s, GrB_FP32)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Scalar_get_VOID_(s, nothing, 0)) ; + + OK (GrB_Scalar_get_SIZE_(s, &size, GrB_EL_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + OK (GrB_Scalar_get_String_(s, name, GrB_EL_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_Scalar_get_String_(s, name, GrB_NAME)) ; + CHECK (MATCH (name, "")) ; + + OK (GrB_Scalar_get_INT32_(s, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + i = -1 ; + OK (GrB_Scalar_get_Scalar_(s, s_int32, GrB_EL_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; + CHECK (i == GrB_FP32_CODE) ; + + GxB_print (s, 3) ; + + OK (GrB_Scalar_get_INT32_(s, &i, GrB_STORAGE_ORIENTATION_HINT)) ; + printf ("scalar storage: %d\n", i) ; + CHECK (i == GrB_COLMAJOR) ; + + 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, 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, GxB_SPARSITY_STATUS)) ; + printf ("sparsity status: %d\n", i) ; + CHECK (i == GxB_FULL) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Scalar_get_INT32_(s_int32, &i, 0)) ; + ERR (GrB_Scalar_get_SIZE_(s, &size, 0)) ; + + ERR (GrB_Scalar_set_Scalar_(s, s_int32, 0)) ; + OK (GrB_Scalar_set_Scalar_(s, s_int32, GrB_STORAGE_ORIENTATION_HINT)) ; + + ERR (GrB_Scalar_set_INT32_(s, 0, 0)) ; + OK (GrB_Scalar_set_INT32_(s, 0, GrB_STORAGE_ORIENTATION_HINT)) ; + + OK (GrB_Scalar_set_String_(s, "scalar name", GrB_NAME)) ; + OK (GrB_Scalar_get_String_(s, name, GrB_NAME)) ; + OK (GrB_Scalar_get_SIZE_(s, &size, GrB_NAME)) ; + CHECK (MATCH (name, "scalar name")) ; + CHECK (size == strlen (name) + 1) ; + + OK (GrB_Scalar_set_String_(s, "another scalar name", GrB_NAME)) ; + OK (GrB_Scalar_get_String_(s, name, GrB_NAME)) ; + OK (GrB_Scalar_get_SIZE_(s, &size, GrB_NAME)) ; + CHECK (MATCH (name, "another scalar name")) ; + CHECK (size == strlen (name) + 1) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Scalar_set_VOID_(s, nothing, 0, 0)) ; + + //-------------------------------------------------------------------------- + // GrB_Vector get/set + //-------------------------------------------------------------------------- + + OK (GrB_Vector_new (&v, GrB_FP32, 10)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Vector_get_VOID_(v, nothing, 0)) ; + + OK (GrB_Vector_get_SIZE_(v, &size, GrB_EL_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + OK (GrB_Vector_get_String_(v, name, GrB_EL_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_Vector_get_String_(v, name, GrB_NAME)) ; + CHECK (MATCH (name, "")) ; + + OK (GrB_Vector_get_INT32_(v, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + i = -1 ; + OK (GrB_Vector_get_Scalar_(v, s_int32, GrB_EL_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; + CHECK (i == GrB_FP32_CODE) ; + + GxB_print (v, 3) ; + + OK (GrB_Vector_get_INT32_(v, &i, GrB_STORAGE_ORIENTATION_HINT)) ; + printf ("vector storage: %d\n", i) ; + CHECK (i == GrB_COLMAJOR) ; + + OK (GrB_Vector_get_INT32_(v, &i, GxB_FORMAT)) ; + printf ("vector storage: %d\n", i) ; + CHECK (i == GxB_BY_COL) ; + + OK (GrB_Vector_set_INT32_(v, GrB_ROWMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Vector_get_INT32_(v, &i, GrB_STORAGE_ORIENTATION_HINT)) ; + CHECK (i == GrB_COLMAJOR) ; + + 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, GxB_SPARSITY_STATUS)) ; + printf ("sparsity status: %d\n", i) ; + CHECK (i == GxB_FULL) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Vector_get_INT32_(v, &i, 0)) ; + ERR (GrB_Vector_get_SIZE_(v, &size, 0)) ; + + fvalue = -1 ; + 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 (abs (fvalue - 0.04) < 1e-6) ; + + OK (GrB_Scalar_setElement_FP32_(s_fp32, 0.5)) ; + 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 (abs (dvalue - 0.5) < 1e-6) ; + + OK (GrB_Scalar_setElement_INT32_(s_int32, GxB_BITMAP)) ; + OK (GrB_Vector_set_Scalar_(v, s_int32, GxB_SPARSITY_CONTROL)) ; + GxB_print (v, 3) ; + + 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, 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, 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)) ; + OK (GrB_Vector_get_SIZE_(v, &size, GrB_NAME)) ; + CHECK (MATCH (name, "vector name")) ; + CHECK (size == strlen (name) + 1) ; + + OK (GrB_Vector_set_String_(v, "another vector name", GrB_NAME)) ; + OK (GrB_Vector_get_String_(v, name, GrB_NAME)) ; + OK (GrB_Vector_get_SIZE_(v, &size, GrB_NAME)) ; + CHECK (MATCH (name, "another vector name")) ; + CHECK (size == strlen (name) + 1) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Vector_set_VOID_(v, nothing, 0, 1)) ; + + expected = GrB_EMPTY_OBJECT ; + OK (GrB_Scalar_clear (s_int32)) ; + ERR (GrB_Vector_set_Scalar_(v, s_int32, GxB_FORMAT)) ; + + //-------------------------------------------------------------------------- + // GrB_Matrix get/set + //-------------------------------------------------------------------------- + + OK (GrB_Matrix_new (&A, GrB_FP32, 5, 5)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Matrix_get_VOID_(A, nothing, 0)) ; + + OK (GrB_Matrix_get_SIZE_(A, &size, GrB_EL_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + OK (GrB_Matrix_get_String_(A, name, GrB_EL_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_Matrix_get_String_(A, name, GrB_NAME)) ; + CHECK (MATCH (name, "")) ; + + OK (GrB_Matrix_get_INT32_(A, &code, GrB_EL_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + i = -1 ; + OK (GrB_Matrix_get_Scalar_(A, s_int32, GrB_EL_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; + CHECK (i == GrB_FP32_CODE) ; + + GxB_print (A, 3) ; + + OK (GrB_Matrix_get_INT32_(A, &i, GrB_STORAGE_ORIENTATION_HINT)) ; + printf ("matrix storage: %d\n", i) ; + CHECK (i == GrB_COLMAJOR) ; + + 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, 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, GxB_SPARSITY_STATUS)) ; + printf ("sparsity status: %d\n", i) ; + CHECK (i == GxB_FULL) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Matrix_get_INT32_(A, &i, 0)) ; + ERR (GrB_Matrix_get_SIZE_(A, &size, 0)) ; + + fvalue = -1 ; + 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 (abs (fvalue - 0.04) < 1e-6) ; + + OK (GrB_Scalar_setElement_FP32_(s_fp32, 0.5)) ; + 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 (abs (dvalue - 0.5) < 1e-6) ; + + OK (GrB_Scalar_setElement_INT32_(s_int32, GxB_BITMAP)) ; + OK (GrB_Matrix_set_Scalar_(A, s_int32, GxB_SPARSITY_CONTROL)) ; + GxB_print (A, 3) ; + + 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, 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 (abs (dvalue - 0.25) < 1e-6) ; + + OK (GrB_Matrix_get_SIZE_(A, &size, GrB_NAME)) ; + CHECK (size == 1) ; + + OK (GrB_Matrix_set_String_(A, "matrix name", GrB_NAME)) ; + OK (GrB_Matrix_get_String_(A, name, GrB_NAME)) ; + OK (GrB_Matrix_get_SIZE_(A, &size, GrB_NAME)) ; + CHECK (MATCH (name, "matrix name")) ; + CHECK (size == strlen (name) + 1) ; + + OK (GrB_Matrix_set_String_(A, "another matrix name", GrB_NAME)) ; + OK (GrB_Matrix_get_String_(A, name, GrB_NAME)) ; + OK (GrB_Matrix_get_SIZE_(A, &size, GrB_NAME)) ; + CHECK (MATCH (name, "another matrix name")) ; + CHECK (size == strlen (name) + 1) ; + + OK (GrB_Matrix_get_String_(A, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "float")) ; + OK (GrB_Matrix_get_SIZE_(A, &size, GxB_JIT_C_NAME)) ; + CHECK (size == strlen ("float") + 1) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Matrix_set_String_ (A, "garbage", 999)) ; + ERR (GrB_Matrix_set_VOID_(A, nothing, 0, 1)) ; + ERR (GrB_Matrix_get_SIZE_(A, &size, 999)) ; + + 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, 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, GxB_FORMAT)) ; + CHECK (i == GxB_BY_COL) ; + GxB_print (A, 3) ; + + expected = GrB_INVALID_VALUE ; + 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, GxB_FORMAT)) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&A) ; + GrB_free (&v) ; + GrB_free (&s) ; + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GrB_free (&s_uint64) ; + GrB_free (&type) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test26: all tests passed.\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test27.c b/GraphBLAS/Test/GB_mex_test27.c new file mode 100644 index 0000000000..8a57ea678f --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test27.c @@ -0,0 +1,476 @@ +//------------------------------------------------------------------------------ +// GB_mex_test27: test GrB_get and GrB_set (unary ops) +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test27" + +#define FREE_ALL ; +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +#define GETOP(op,opname) \ +{ \ + OK (GrB_UnaryOp_get_String (op, name, GrB_NAME)) ; \ + CHECK (MATCH (name, opname)) ; \ + OK (GrB_UnaryOp_get_String (op, cname, GxB_JIT_C_NAME)) ; \ + printf ("%s: %s\n", name, cname) ; \ + OK (GrB_UnaryOp_get_SIZE (op, &size, GrB_NAME)) ; \ + CHECK (size == strlen (name) + 1) ; \ + GrB_Info info2, info3 ; \ + info2 = GrB_UnaryOp_get_SIZE (op, &size, GrB_INP0_TYPE_STRING) ; \ + info3 = GrB_UnaryOp_get_String (op, name, GrB_INP0_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (size == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (size == 1) ; } \ + info2 = GrB_UnaryOp_get_SIZE (op, &size, GrB_INP1_TYPE_STRING) ; \ + info3 = GrB_UnaryOp_get_String (op, name, GrB_INP1_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (size == 1) ; \ + CHECK (info2 == GrB_NO_VALUE) ; \ + info2 = GrB_UnaryOp_get_SIZE (op, &size, GrB_OUTP_TYPE_STRING) ; \ + info3 = GrB_UnaryOp_get_String (op, name, GrB_OUTP_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (size == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (size == 1) ; } \ +} + +#define GETNAME(op) \ +{ \ + GETOP (op, #op) ; \ +/* OK (GxB_UnaryOp_fprint (op, "unop", 3, NULL)) ; */ \ +} + +#define GETNAM2(op,alias) \ +{ \ + GETOP (op,alias) ; \ +/* OK (GxB_UnaryOp_fprint (op, "unop", 3, NULL)) ; */ \ +} + +void myfunc (float *z, const float *x) ; +void myfunc (float *z, const float *x) { (*z) = -(*x) ; } +#define MYFUNC_DEFN \ +"void myfunc (float *z, const float *x) { (*z) = -(*x) ; }" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL ; + GrB_UnaryOp unop = NULL ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size ; + char name [256] ; + char cname [256] ; + char defn [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + + //-------------------------------------------------------------------------- + // GrB_UnaryOp get name + //-------------------------------------------------------------------------- + + GETNAME (GrB_IDENTITY_BOOL) ; + GETNAME (GrB_IDENTITY_INT8) ; + GETNAME (GrB_IDENTITY_INT16) ; + GETNAME (GrB_IDENTITY_INT32) ; + GETNAME (GrB_IDENTITY_INT64) ; + GETNAME (GrB_IDENTITY_UINT8) ; + GETNAME (GrB_IDENTITY_UINT16) ; + GETNAME (GrB_IDENTITY_UINT32) ; + GETNAME (GrB_IDENTITY_UINT64) ; + GETNAME (GrB_IDENTITY_FP32) ; + GETNAME (GrB_IDENTITY_FP64) ; + GETNAME (GxB_IDENTITY_FC32) ; + GETNAME (GxB_IDENTITY_FC64) ; + + GETNAME (GrB_AINV_BOOL) ; + GETNAME (GrB_AINV_INT8) ; + GETNAME (GrB_AINV_INT16) ; + GETNAME (GrB_AINV_INT32) ; + GETNAME (GrB_AINV_INT64) ; + GETNAME (GrB_AINV_UINT8) ; + GETNAME (GrB_AINV_UINT16) ; + GETNAME (GrB_AINV_UINT32) ; + GETNAME (GrB_AINV_UINT64) ; + GETNAME (GrB_AINV_FP32) ; + GETNAME (GrB_AINV_FP64) ; + GETNAME (GxB_AINV_FC32) ; + GETNAME (GxB_AINV_FC64) ; + + GETNAME (GrB_MINV_BOOL) ; + GETNAME (GrB_MINV_INT8) ; + GETNAME (GrB_MINV_INT16) ; + GETNAME (GrB_MINV_INT32) ; + GETNAME (GrB_MINV_INT64) ; + GETNAME (GrB_MINV_UINT8) ; + GETNAME (GrB_MINV_UINT16) ; + GETNAME (GrB_MINV_UINT32) ; + GETNAME (GrB_MINV_UINT64) ; + GETNAME (GrB_MINV_FP32) ; + GETNAME (GrB_MINV_FP64) ; + GETNAME (GxB_MINV_FC32) ; + GETNAME (GxB_MINV_FC64) ; + + GETNAME (GrB_LNOT) ; + GETNAM2 (GxB_LNOT_BOOL, "GrB_LNOT") ; + GETNAME (GxB_LNOT_INT8) ; + GETNAME (GxB_LNOT_INT16) ; + GETNAME (GxB_LNOT_INT32) ; + GETNAME (GxB_LNOT_INT64) ; + GETNAME (GxB_LNOT_UINT8) ; + GETNAME (GxB_LNOT_UINT16) ; + GETNAME (GxB_LNOT_UINT32) ; + GETNAME (GxB_LNOT_UINT64) ; + GETNAME (GxB_LNOT_FP32) ; + GETNAME (GxB_LNOT_FP64) ; + + GETNAME (GxB_ONE_BOOL) ; + GETNAME (GxB_ONE_INT8) ; + GETNAME (GxB_ONE_INT16) ; + GETNAME (GxB_ONE_INT32) ; + GETNAME (GxB_ONE_INT64) ; + GETNAME (GxB_ONE_UINT8) ; + GETNAME (GxB_ONE_UINT16) ; + GETNAME (GxB_ONE_UINT32) ; + GETNAME (GxB_ONE_UINT64) ; + GETNAME (GxB_ONE_FP32) ; + GETNAME (GxB_ONE_FP64) ; + GETNAME (GxB_ONE_FC32) ; + GETNAME (GxB_ONE_FC64) ; + + GETNAME (GrB_ABS_BOOL) ; + GETNAME (GrB_ABS_INT8) ; + GETNAME (GrB_ABS_INT16) ; + GETNAME (GrB_ABS_INT32) ; + GETNAME (GrB_ABS_INT64) ; + GETNAME (GrB_ABS_UINT8) ; + GETNAME (GrB_ABS_UINT16) ; + GETNAME (GrB_ABS_UINT32) ; + GETNAME (GrB_ABS_UINT64) ; + GETNAME (GrB_ABS_FP32) ; + GETNAME (GrB_ABS_FP64) ; + + GETNAME (GrB_BNOT_INT8) ; + GETNAME (GrB_BNOT_INT16) ; + GETNAME (GrB_BNOT_INT32) ; + GETNAME (GrB_BNOT_INT64) ; + GETNAME (GrB_BNOT_UINT8) ; + GETNAME (GrB_BNOT_UINT16) ; + GETNAME (GrB_BNOT_UINT32) ; + GETNAME (GrB_BNOT_UINT64) ; + + GETNAM2 (GxB_ABS_BOOL, "GrB_ABS_BOOL") ; + GETNAM2 (GxB_ABS_INT8, "GrB_ABS_INT8") ; + GETNAM2 (GxB_ABS_INT16, "GrB_ABS_INT16") ; + GETNAM2 (GxB_ABS_INT32, "GrB_ABS_INT32") ; + GETNAM2 (GxB_ABS_INT64, "GrB_ABS_INT64") ; + GETNAM2 (GxB_ABS_UINT8, "GrB_ABS_UINT8") ; + GETNAM2 (GxB_ABS_UINT16, "GrB_ABS_UINT16") ; + GETNAM2 (GxB_ABS_UINT32, "GrB_ABS_UINT32") ; + GETNAM2 (GxB_ABS_UINT64, "GrB_ABS_UINT64") ; + GETNAM2 (GxB_ABS_FP32, "GrB_ABS_FP32") ; + GETNAM2 (GxB_ABS_FP64, "GrB_ABS_FP64") ; + GETNAME (GxB_ABS_FC32) ; + GETNAME (GxB_ABS_FC64) ; + + GETNAME (GxB_SQRT_FP32) ; + GETNAME (GxB_SQRT_FP64) ; + GETNAME (GxB_SQRT_FC32) ; + GETNAME (GxB_SQRT_FC64) ; + + GETNAME (GxB_LOG_FP32) ; + GETNAME (GxB_LOG_FP64) ; + GETNAME (GxB_LOG_FC32) ; + GETNAME (GxB_LOG_FC64) ; + + GETNAME (GxB_EXP_FP32) ; + GETNAME (GxB_EXP_FP64) ; + GETNAME (GxB_EXP_FC32) ; + GETNAME (GxB_EXP_FC64) ; + + GETNAME (GxB_LOG2_FP32) ; + GETNAME (GxB_LOG2_FP64) ; + GETNAME (GxB_LOG2_FC32) ; + GETNAME (GxB_LOG2_FC64) ; + + GETNAME (GxB_SIN_FP32) ; + GETNAME (GxB_SIN_FP64) ; + GETNAME (GxB_SIN_FC32) ; + GETNAME (GxB_SIN_FC64) ; + + GETNAME (GxB_COS_FP32) ; + GETNAME (GxB_COS_FP64) ; + GETNAME (GxB_COS_FC32) ; + GETNAME (GxB_COS_FC64) ; + + GETNAME (GxB_TAN_FP32) ; + GETNAME (GxB_TAN_FP64) ; + GETNAME (GxB_TAN_FC32) ; + GETNAME (GxB_TAN_FC64) ; + + GETNAME (GxB_ACOS_FP32) ; + GETNAME (GxB_ACOS_FP64) ; + GETNAME (GxB_ACOS_FC32) ; + GETNAME (GxB_ACOS_FC64) ; + + GETNAME (GxB_ASIN_FP32) ; + GETNAME (GxB_ASIN_FP64) ; + GETNAME (GxB_ASIN_FC32) ; + GETNAME (GxB_ASIN_FC64) ; + + GETNAME (GxB_ATAN_FP32) ; + GETNAME (GxB_ATAN_FP64) ; + GETNAME (GxB_ATAN_FC32) ; + GETNAME (GxB_ATAN_FC64) ; + + GETNAME (GxB_SINH_FP32) ; + GETNAME (GxB_SINH_FP64) ; + GETNAME (GxB_SINH_FC32) ; + GETNAME (GxB_SINH_FC64) ; + + GETNAME (GxB_COSH_FP32) ; + GETNAME (GxB_COSH_FP64) ; + GETNAME (GxB_COSH_FC32) ; + GETNAME (GxB_COSH_FC64) ; + + GETNAME (GxB_TANH_FP32) ; + GETNAME (GxB_TANH_FP64) ; + GETNAME (GxB_TANH_FC32) ; + GETNAME (GxB_TANH_FC64) ; + + GETNAME (GxB_ATANH_FP32) ; + GETNAME (GxB_ATANH_FP64) ; + GETNAME (GxB_ATANH_FC32) ; + GETNAME (GxB_ATANH_FC64) ; + + GETNAME (GxB_ASINH_FP32) ; + GETNAME (GxB_ASINH_FP64) ; + GETNAME (GxB_ASINH_FC32) ; + GETNAME (GxB_ASINH_FC64) ; + + GETNAME (GxB_ACOSH_FP32) ; + GETNAME (GxB_ACOSH_FP64) ; + GETNAME (GxB_ACOSH_FC32) ; + GETNAME (GxB_ACOSH_FC64) ; + + GETNAME (GxB_SIGNUM_FP32) ; + GETNAME (GxB_SIGNUM_FP64) ; + GETNAME (GxB_SIGNUM_FC32) ; + GETNAME (GxB_SIGNUM_FC64) ; + + GETNAME (GxB_CEIL_FP32) ; + GETNAME (GxB_CEIL_FP64) ; + GETNAME (GxB_CEIL_FC32) ; + GETNAME (GxB_CEIL_FC64) ; + + GETNAME (GxB_FLOOR_FP32) ; + GETNAME (GxB_FLOOR_FP64) ; + GETNAME (GxB_FLOOR_FC32) ; + GETNAME (GxB_FLOOR_FC64) ; + + GETNAME (GxB_ROUND_FP32) ; + GETNAME (GxB_ROUND_FP64) ; + GETNAME (GxB_ROUND_FC32) ; + GETNAME (GxB_ROUND_FC64) ; + + GETNAME (GxB_TRUNC_FP32) ; + GETNAME (GxB_TRUNC_FP64) ; + GETNAME (GxB_TRUNC_FC32) ; + GETNAME (GxB_TRUNC_FC64) ; + + GETNAME (GxB_EXP2_FP32) ; + GETNAME (GxB_EXP2_FP64) ; + GETNAME (GxB_EXP2_FC32) ; + GETNAME (GxB_EXP2_FC64) ; + + GETNAME (GxB_EXPM1_FP32) ; + GETNAME (GxB_EXPM1_FP64) ; + GETNAME (GxB_EXPM1_FC32) ; + GETNAME (GxB_EXPM1_FC64) ; + + GETNAME (GxB_LOG10_FP32) ; + GETNAME (GxB_LOG10_FP64) ; + GETNAME (GxB_LOG10_FC32) ; + GETNAME (GxB_LOG10_FC64) ; + + GETNAME (GxB_LOG1P_FP32) ; + GETNAME (GxB_LOG1P_FP64) ; + GETNAME (GxB_LOG1P_FC32) ; + GETNAME (GxB_LOG1P_FC64) ; + + GETNAME (GxB_LGAMMA_FP32) ; + GETNAME (GxB_LGAMMA_FP64) ; + + GETNAME (GxB_TGAMMA_FP32) ; + GETNAME (GxB_TGAMMA_FP64) ; + + GETNAME (GxB_ERF_FP32) ; + GETNAME (GxB_ERF_FP64) ; + + GETNAME (GxB_ERFC_FP32) ; + GETNAME (GxB_ERFC_FP64) ; + + GETNAME (GxB_CBRT_FP32) ; + GETNAME (GxB_CBRT_FP64) ; + + GETNAME (GxB_FREXPX_FP32) ; + GETNAME (GxB_FREXPX_FP64) ; + + GETNAME (GxB_FREXPE_FP32) ; + GETNAME (GxB_FREXPE_FP64) ; + + GETNAME (GxB_CONJ_FC32) ; + GETNAME (GxB_CONJ_FC64) ; + + GETNAME (GxB_CREAL_FC32) ; + GETNAME (GxB_CREAL_FC64) ; + + GETNAME (GxB_CIMAG_FC32) ; + GETNAME (GxB_CIMAG_FC64) ; + + GETNAME (GxB_CARG_FC32) ; + GETNAME (GxB_CARG_FC64) ; + + GETNAME (GxB_ISINF_FP32) ; + GETNAME (GxB_ISINF_FP64) ; + GETNAME (GxB_ISINF_FC32) ; + GETNAME (GxB_ISINF_FC64) ; + + GETNAME (GxB_ISNAN_FP32) ; + GETNAME (GxB_ISNAN_FP64) ; + GETNAME (GxB_ISNAN_FC32) ; + GETNAME (GxB_ISNAN_FC64) ; + + GETNAME (GxB_ISFINITE_FP32) ; + GETNAME (GxB_ISFINITE_FP64) ; + GETNAME (GxB_ISFINITE_FC32) ; + GETNAME (GxB_ISFINITE_FC64) ; + + GETNAME (GxB_POSITIONI_INT32) ; + GETNAME (GxB_POSITIONI_INT64) ; + GETNAME (GxB_POSITIONI1_INT32) ; + GETNAME (GxB_POSITIONI1_INT64) ; + + GETNAME (GxB_POSITIONJ_INT32) ; + GETNAME (GxB_POSITIONJ_INT64) ; + GETNAME (GxB_POSITIONJ1_INT32) ; + GETNAME (GxB_POSITIONJ1_INT64) ; + + //-------------------------------------------------------------------------- + // other get/set methods for GrB_UnaryOp + //-------------------------------------------------------------------------- + + OK (GrB_UnaryOp_get_INT32_(GrB_ABS_FP32, &code, GrB_INP0_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_UnaryOp_get_String_(GrB_ABS_FP32, name, GrB_INP0_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_UnaryOp_get_INT32_(GrB_ABS_FP64, &code, GrB_OUTP_TYPE_CODE)) ; + CHECK (code == GrB_FP64_CODE) ; + + OK (GrB_UnaryOp_get_String_(GrB_ABS_FP64, name, GrB_OUTP_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP64")) ; + + OK (GrB_UnaryOp_get_Scalar_(GrB_ABS_FP32, s_int32, GrB_INP0_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_UnaryOp_get_Scalar_(GrB_LNOT, s_int32, GrB_OUTP_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_BOOL_CODE) ; + + expected = GrB_NO_VALUE ; + ERR (GrB_UnaryOp_get_INT32_(GrB_BNOT_UINT8, &code, GrB_INP1_TYPE_CODE)) ; + ERR (GrB_UnaryOp_get_Scalar_(GrB_LNOT, s_int32, GrB_INP1_TYPE_CODE)) ; + ERR (GrB_UnaryOp_get_String_(GrB_BNOT_UINT8, name, GrB_INP1_TYPE_STRING)) ; + ERR (GrB_UnaryOp_get_SIZE_(GrB_BNOT_UINT8, &size, GrB_INP1_TYPE_STRING)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_UnaryOp_get_INT32_(GrB_BNOT_UINT8, &code, GrB_NAME)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_UnaryOp_get_VOID_(GrB_LNOT, nothing, 0)) ; + + OK (GrB_UnaryOp_new (&unop, myfunc, GrB_FP32, GrB_FP32)) ; + OK (GrB_UnaryOp_get_SIZE_(unop, &size, GrB_NAME)) ; + CHECK (size == 1) ; + OK (GrB_UnaryOp_get_SIZE_(unop, &size, GxB_JIT_C_NAME)) ; + CHECK (size == 1) ; + OK (GrB_UnaryOp_get_SIZE_(unop, &size, GxB_JIT_C_DEFINITION)) ; + CHECK (size == 1) ; + + expected = GrB_INVALID_VALUE ; + OK (GrB_UnaryOp_set_String_(unop, "myfunc", GxB_JIT_C_NAME)) ; + OK (GrB_UnaryOp_get_String_(unop, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "myfunc")) ; + + CHECK (unop->hash == UINT64_MAX) ; + METHOD (GrB_UnaryOp_set_String (unop, MYFUNC_DEFN, GxB_JIT_C_DEFINITION)) ; + OK (GrB_UnaryOp_get_String_(unop, defn, GxB_JIT_C_DEFINITION)) ; + CHECK (MATCH (defn, MYFUNC_DEFN)) ; + CHECK (unop->hash != UINT64_MAX) ; + OK (GxB_print (unop, 3)) ; + + OK (GrB_UnaryOp_set_String_(unop, "user name for myfunc", GrB_NAME)) ; + OK (GrB_UnaryOp_get_String_(unop, name, GrB_NAME)) ; + CHECK (MATCH (name, "user name for myfunc")) ; + expected = GrB_ALREADY_SET ; + ERR (GrB_UnaryOp_set_String_(unop, "another user name", GrB_NAME)) ; + printf (" test GrB_ALREADY_SET: ok\n") ; + + expected = GrB_NO_VALUE ; + ERR (GrB_UnaryOp_get_INT32_(unop, &code, GrB_INP1_TYPE_CODE)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_UnaryOp_set_String_(unop, "another_name", 999)) ; + ERR (GrB_UnaryOp_get_SIZE(unop, &size, 999)) ; + + expected = GrB_ALREADY_SET ; + ERR (GrB_UnaryOp_set_String_(unop, "another_name", GxB_JIT_C_NAME)) ; + ERR (GrB_UnaryOp_set_String_(unop, "another_defn", GxB_JIT_C_DEFINITION)) ; + CHECK (MATCH ("GrB_ALREADY_SET", GB_status_code (GrB_ALREADY_SET))) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_UnaryOp_set_String_(GrB_LNOT, "another_name", GxB_JIT_C_NAME)) ; + ERR (GrB_UnaryOp_set_Scalar_(unop, s_int32, 0)) ; + ERR (GrB_UnaryOp_set_INT32_(unop, 0, 0)) ; + ERR (GrB_UnaryOp_set_VOID_(unop, nothing, 0, 0)) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GrB_free (&unop) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test27: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test28.c b/GraphBLAS/Test/GB_mex_test28.c new file mode 100644 index 0000000000..cd7899b959 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test28.c @@ -0,0 +1,680 @@ +//------------------------------------------------------------------------------ +// GB_mex_test28: test GrB_get and GrB_set (binary ops) +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test28" + +#define FREE_ALL ; +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +#define GETOP(op,opname) \ +{ \ + size_t siz1, siz2, siz3 ; \ + OK (GrB_BinaryOp_get_String (op, name, GrB_NAME)) ; \ + CHECK (MATCH (name, opname)) ; \ + OK (GrB_BinaryOp_get_String (op, cname, GxB_JIT_C_NAME)) ; \ + printf ("%s: %s\n", name, cname) ; \ + OK (GrB_BinaryOp_get_SIZE (op, &size, GrB_NAME)) ; \ + CHECK (size == strlen (name) + 1) ; \ + GrB_Info info2, info3 ; \ + info2 = GrB_BinaryOp_get_SIZE (op, &siz1, GrB_INP0_TYPE_STRING) ; \ + info3 = GrB_BinaryOp_get_String (op, name, GrB_INP0_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz1 == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (siz1 == 1) ; } \ + info2 = GrB_BinaryOp_get_SIZE (op, &siz2, GrB_INP1_TYPE_STRING) ; \ + info3 = GrB_BinaryOp_get_String (op, name, GrB_INP1_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz2 == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (siz2 == 1) ; } \ + info2 = GrB_BinaryOp_get_SIZE (op, &siz3, GrB_OUTP_TYPE_STRING) ; \ + info3 = GrB_BinaryOp_get_String (op, name, GrB_OUTP_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz3 == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (siz3 == 1) ; } \ +} + +#define GETNAME(op) \ +{ \ + GETOP (op, #op) ; \ +/* OK (GxB_BinaryOp_fprint (op, "binop", 3, NULL)) ; */ \ +} + +#define GETNAM2(op,alias) \ +{ \ + GETOP (op,alias) ; \ +/* OK (GxB_BinaryOp_fprint (op, "binop", 3, NULL)) ; */ \ +} + +void myfunc (float *z, const float *x, const float *y) ; +void myfunc (float *z, const float *x, const float *y) { (*z) = (*x)+(*y) ; } +#define MYFUNC_DEFN \ +"void myfunc (float *z, const float *x, const float *y) { (*z) = (*x)+(*y) ; }" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL ; + GrB_BinaryOp binop = NULL ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size ; + char name [256] ; + char cname [256] ; + char defn [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + + //-------------------------------------------------------------------------- + // GrB_BinaryOp get name + //-------------------------------------------------------------------------- + + GETNAME (GrB_FIRST_BOOL) ; + GETNAME (GrB_FIRST_INT8) ; + GETNAME (GrB_FIRST_INT16) ; + GETNAME (GrB_FIRST_INT32) ; + GETNAME (GrB_FIRST_INT64) ; + GETNAME (GrB_FIRST_UINT8) ; + GETNAME (GrB_FIRST_UINT16) ; + GETNAME (GrB_FIRST_UINT32) ; + GETNAME (GrB_FIRST_UINT64) ; + GETNAME (GrB_FIRST_FP32) ; + GETNAME (GrB_FIRST_FP64) ; + GETNAME (GxB_FIRST_FC32) ; + GETNAME (GxB_FIRST_FC64) ; + + GETNAME (GrB_SECOND_BOOL) ; + GETNAME (GrB_SECOND_INT8) ; + GETNAME (GrB_SECOND_INT16) ; + GETNAME (GrB_SECOND_INT32) ; + GETNAME (GrB_SECOND_INT64) ; + GETNAME (GrB_SECOND_UINT8) ; + GETNAME (GrB_SECOND_UINT16) ; + GETNAME (GrB_SECOND_UINT32) ; + GETNAME (GrB_SECOND_UINT64) ; + GETNAME (GrB_SECOND_FP32) ; + GETNAME (GrB_SECOND_FP64) ; + GETNAME (GxB_SECOND_FC32) ; + GETNAME (GxB_SECOND_FC64) ; + + GETNAME (GrB_ONEB_BOOL) ; + GETNAME (GrB_ONEB_INT8) ; + GETNAME (GrB_ONEB_INT16) ; + GETNAME (GrB_ONEB_INT32) ; + GETNAME (GrB_ONEB_INT64) ; + GETNAME (GrB_ONEB_UINT8) ; + GETNAME (GrB_ONEB_UINT16) ; + GETNAME (GrB_ONEB_UINT32) ; + GETNAME (GrB_ONEB_UINT64) ; + GETNAME (GrB_ONEB_FP32) ; + GETNAME (GrB_ONEB_FP64) ; + GETNAME (GxB_ONEB_FC32) ; + GETNAME (GxB_ONEB_FC64) ; + + GETNAME (GxB_POW_BOOL) ; + GETNAME (GxB_POW_INT8) ; + GETNAME (GxB_POW_INT16) ; + GETNAME (GxB_POW_INT32) ; + GETNAME (GxB_POW_INT64) ; + GETNAME (GxB_POW_UINT8) ; + GETNAME (GxB_POW_UINT16) ; + GETNAME (GxB_POW_UINT32) ; + GETNAME (GxB_POW_UINT64) ; + GETNAME (GxB_POW_FP32) ; + GETNAME (GxB_POW_FP64) ; + GETNAME (GxB_POW_FC32) ; + GETNAME (GxB_POW_FC64) ; + + GETNAME (GrB_PLUS_BOOL) ; + GETNAME (GrB_PLUS_INT8) ; + GETNAME (GrB_PLUS_INT16) ; + GETNAME (GrB_PLUS_INT32) ; + GETNAME (GrB_PLUS_INT64) ; + GETNAME (GrB_PLUS_UINT8) ; + GETNAME (GrB_PLUS_UINT16) ; + GETNAME (GrB_PLUS_UINT32) ; + GETNAME (GrB_PLUS_UINT64) ; + GETNAME (GrB_PLUS_FP32) ; + GETNAME (GrB_PLUS_FP64) ; + GETNAME (GxB_PLUS_FC32) ; + GETNAME (GxB_PLUS_FC64) ; + + GETNAME (GrB_MINUS_BOOL) ; + GETNAME (GrB_MINUS_INT8) ; + GETNAME (GrB_MINUS_INT16) ; + GETNAME (GrB_MINUS_INT32) ; + GETNAME (GrB_MINUS_INT64) ; + GETNAME (GrB_MINUS_UINT8) ; + GETNAME (GrB_MINUS_UINT16) ; + GETNAME (GrB_MINUS_UINT32) ; + GETNAME (GrB_MINUS_UINT64) ; + GETNAME (GrB_MINUS_FP32) ; + GETNAME (GrB_MINUS_FP64) ; + GETNAME (GxB_MINUS_FC32) ; + GETNAME (GxB_MINUS_FC64) ; + + GETNAME (GrB_TIMES_BOOL) ; + GETNAME (GrB_TIMES_INT8) ; + GETNAME (GrB_TIMES_INT16) ; + GETNAME (GrB_TIMES_INT32) ; + GETNAME (GrB_TIMES_INT64) ; + GETNAME (GrB_TIMES_UINT8) ; + GETNAME (GrB_TIMES_UINT16) ; + GETNAME (GrB_TIMES_UINT32) ; + GETNAME (GrB_TIMES_UINT64) ; + GETNAME (GrB_TIMES_FP32) ; + GETNAME (GrB_TIMES_FP64) ; + GETNAME (GxB_TIMES_FC32) ; + GETNAME (GxB_TIMES_FC64) ; + + GETNAME (GrB_DIV_BOOL) ; + GETNAME (GrB_DIV_INT8) ; + GETNAME (GrB_DIV_INT16) ; + GETNAME (GrB_DIV_INT32) ; + GETNAME (GrB_DIV_INT64) ; + GETNAME (GrB_DIV_UINT8) ; + GETNAME (GrB_DIV_UINT16) ; + GETNAME (GrB_DIV_UINT32) ; + GETNAME (GrB_DIV_UINT64) ; + GETNAME (GrB_DIV_FP32) ; + GETNAME (GrB_DIV_FP64) ; + GETNAME (GxB_DIV_FC32) ; + GETNAME (GxB_DIV_FC64) ; + + GETNAME (GxB_RMINUS_BOOL) ; + GETNAME (GxB_RMINUS_INT8) ; + GETNAME (GxB_RMINUS_INT16) ; + GETNAME (GxB_RMINUS_INT32) ; + GETNAME (GxB_RMINUS_INT64) ; + GETNAME (GxB_RMINUS_UINT8) ; + GETNAME (GxB_RMINUS_UINT16) ; + GETNAME (GxB_RMINUS_UINT32) ; + GETNAME (GxB_RMINUS_UINT64) ; + GETNAME (GxB_RMINUS_FP32) ; + GETNAME (GxB_RMINUS_FP64) ; + GETNAME (GxB_RMINUS_FC32) ; + GETNAME (GxB_RMINUS_FC64) ; + + GETNAME (GxB_RDIV_BOOL) ; + GETNAME (GxB_RDIV_INT8) ; + GETNAME (GxB_RDIV_INT16) ; + GETNAME (GxB_RDIV_INT32) ; + GETNAME (GxB_RDIV_INT64) ; + GETNAME (GxB_RDIV_UINT8) ; + GETNAME (GxB_RDIV_UINT16) ; + GETNAME (GxB_RDIV_UINT32) ; + GETNAME (GxB_RDIV_UINT64) ; + GETNAME (GxB_RDIV_FP32) ; + GETNAME (GxB_RDIV_FP64) ; + GETNAME (GxB_RDIV_FC32) ; + GETNAME (GxB_RDIV_FC64) ; + + GETNAM2 (GxB_PAIR_BOOL, "GrB_ONEB_BOOL") ; + GETNAM2 (GxB_PAIR_INT8, "GrB_ONEB_INT8") ; + GETNAM2 (GxB_PAIR_INT16, "GrB_ONEB_INT16") ; + GETNAM2 (GxB_PAIR_INT32, "GrB_ONEB_INT32") ; + GETNAM2 (GxB_PAIR_INT64, "GrB_ONEB_INT64") ; + GETNAM2 (GxB_PAIR_UINT8, "GrB_ONEB_UINT8") ; + GETNAM2 (GxB_PAIR_UINT16, "GrB_ONEB_UINT16") ; + GETNAM2 (GxB_PAIR_UINT32, "GrB_ONEB_UINT32") ; + GETNAM2 (GxB_PAIR_UINT64, "GrB_ONEB_UINT64") ; + GETNAM2 (GxB_PAIR_FP32, "GrB_ONEB_FP32") ; + GETNAM2 (GxB_PAIR_FP64, "GrB_ONEB_FP64") ; + GETNAM2 (GxB_PAIR_FC32, "GxB_ONEB_FC32") ; + GETNAM2 (GxB_PAIR_FC64, "GxB_ONEB_FC64") ; + + GETNAME (GxB_ANY_BOOL) ; + GETNAME (GxB_ANY_INT8) ; + GETNAME (GxB_ANY_INT16) ; + GETNAME (GxB_ANY_INT32) ; + GETNAME (GxB_ANY_INT64) ; + GETNAME (GxB_ANY_UINT8) ; + GETNAME (GxB_ANY_UINT16) ; + GETNAME (GxB_ANY_UINT32) ; + GETNAME (GxB_ANY_UINT64) ; + GETNAME (GxB_ANY_FP32) ; + GETNAME (GxB_ANY_FP64) ; + GETNAME (GxB_ANY_FC32) ; + GETNAME (GxB_ANY_FC64) ; + + GETNAME (GxB_ISEQ_BOOL) ; + GETNAME (GxB_ISEQ_INT8) ; + GETNAME (GxB_ISEQ_INT16) ; + GETNAME (GxB_ISEQ_INT32) ; + GETNAME (GxB_ISEQ_INT64) ; + GETNAME (GxB_ISEQ_UINT8) ; + GETNAME (GxB_ISEQ_UINT16) ; + GETNAME (GxB_ISEQ_UINT32) ; + GETNAME (GxB_ISEQ_UINT64) ; + GETNAME (GxB_ISEQ_FP32) ; + GETNAME (GxB_ISEQ_FP64) ; + GETNAME (GxB_ISEQ_FC32) ; + GETNAME (GxB_ISEQ_FC64) ; + + GETNAME (GxB_ISNE_BOOL) ; + GETNAME (GxB_ISNE_INT8) ; + GETNAME (GxB_ISNE_INT16) ; + GETNAME (GxB_ISNE_INT32) ; + GETNAME (GxB_ISNE_INT64) ; + GETNAME (GxB_ISNE_UINT8) ; + GETNAME (GxB_ISNE_UINT16) ; + GETNAME (GxB_ISNE_UINT32) ; + GETNAME (GxB_ISNE_UINT64) ; + GETNAME (GxB_ISNE_FP32) ; + GETNAME (GxB_ISNE_FP64) ; + GETNAME (GxB_ISNE_FC32) ; + GETNAME (GxB_ISNE_FC64) ; + + GETNAME (GxB_ISGT_BOOL) ; + GETNAME (GxB_ISGT_INT8) ; + GETNAME (GxB_ISGT_INT16) ; + GETNAME (GxB_ISGT_INT32) ; + GETNAME (GxB_ISGT_INT64) ; + GETNAME (GxB_ISGT_UINT8) ; + GETNAME (GxB_ISGT_UINT16) ; + GETNAME (GxB_ISGT_UINT32) ; + GETNAME (GxB_ISGT_UINT64) ; + GETNAME (GxB_ISGT_FP32) ; + GETNAME (GxB_ISGT_FP64) ; + + GETNAME (GxB_ISLT_BOOL) ; + GETNAME (GxB_ISLT_INT8) ; + GETNAME (GxB_ISLT_INT16) ; + GETNAME (GxB_ISLT_INT32) ; + GETNAME (GxB_ISLT_INT64) ; + GETNAME (GxB_ISLT_UINT8) ; + GETNAME (GxB_ISLT_UINT16) ; + GETNAME (GxB_ISLT_UINT32) ; + GETNAME (GxB_ISLT_UINT64) ; + GETNAME (GxB_ISLT_FP32) ; + GETNAME (GxB_ISLT_FP64) ; + + GETNAME (GxB_ISGE_BOOL) ; + GETNAME (GxB_ISGE_INT8) ; + GETNAME (GxB_ISGE_INT16) ; + GETNAME (GxB_ISGE_INT32) ; + GETNAME (GxB_ISGE_INT64) ; + GETNAME (GxB_ISGE_UINT8) ; + GETNAME (GxB_ISGE_UINT16) ; + GETNAME (GxB_ISGE_UINT32) ; + GETNAME (GxB_ISGE_UINT64) ; + GETNAME (GxB_ISGE_FP32) ; + GETNAME (GxB_ISGE_FP64) ; + + GETNAME (GxB_ISLE_BOOL) ; + GETNAME (GxB_ISLE_INT8) ; + GETNAME (GxB_ISLE_INT16) ; + GETNAME (GxB_ISLE_INT32) ; + GETNAME (GxB_ISLE_INT64) ; + GETNAME (GxB_ISLE_UINT8) ; + GETNAME (GxB_ISLE_UINT16) ; + GETNAME (GxB_ISLE_UINT32) ; + GETNAME (GxB_ISLE_UINT64) ; + GETNAME (GxB_ISLE_FP32) ; + GETNAME (GxB_ISLE_FP64) ; + + GETNAME (GrB_MIN_BOOL) ; + GETNAME (GrB_MIN_INT8) ; + GETNAME (GrB_MIN_INT16) ; + GETNAME (GrB_MIN_INT32) ; + GETNAME (GrB_MIN_INT64) ; + GETNAME (GrB_MIN_UINT8) ; + GETNAME (GrB_MIN_UINT16) ; + GETNAME (GrB_MIN_UINT32) ; + GETNAME (GrB_MIN_UINT64) ; + GETNAME (GrB_MIN_FP32) ; + GETNAME (GrB_MIN_FP64) ; + + GETNAME (GrB_MAX_BOOL) ; + GETNAME (GrB_MAX_INT8) ; + GETNAME (GrB_MAX_INT16) ; + GETNAME (GrB_MAX_INT32) ; + GETNAME (GrB_MAX_INT64) ; + GETNAME (GrB_MAX_UINT8) ; + GETNAME (GrB_MAX_UINT16) ; + GETNAME (GrB_MAX_UINT32) ; + GETNAME (GrB_MAX_UINT64) ; + GETNAME (GrB_MAX_FP32) ; + GETNAME (GrB_MAX_FP64) ; + + GETNAME (GrB_LOR) ; + GETNAM2 (GxB_LOR_BOOL, "GrB_LOR") ; + GETNAME (GxB_LOR_INT8) ; + GETNAME (GxB_LOR_INT16) ; + GETNAME (GxB_LOR_INT32) ; + GETNAME (GxB_LOR_INT64) ; + GETNAME (GxB_LOR_UINT8) ; + GETNAME (GxB_LOR_UINT16) ; + GETNAME (GxB_LOR_UINT32) ; + GETNAME (GxB_LOR_UINT64) ; + GETNAME (GxB_LOR_FP32) ; + GETNAME (GxB_LOR_FP64) ; + + GETNAME (GrB_LAND) ; + GETNAM2 (GxB_LAND_BOOL, "GrB_LAND") ; + GETNAME (GxB_LAND_INT8) ; + GETNAME (GxB_LAND_INT16) ; + GETNAME (GxB_LAND_INT32) ; + GETNAME (GxB_LAND_INT64) ; + GETNAME (GxB_LAND_UINT8) ; + GETNAME (GxB_LAND_UINT16) ; + GETNAME (GxB_LAND_UINT32) ; + GETNAME (GxB_LAND_UINT64) ; + GETNAME (GxB_LAND_FP32) ; + GETNAME (GxB_LAND_FP64) ; + + GETNAME (GrB_LXOR) ; + GETNAM2 (GxB_LXOR_BOOL, "GrB_LXOR") ; + GETNAME (GxB_LXOR_INT8) ; + GETNAME (GxB_LXOR_INT16) ; + GETNAME (GxB_LXOR_INT32) ; + GETNAME (GxB_LXOR_INT64) ; + GETNAME (GxB_LXOR_UINT8) ; + GETNAME (GxB_LXOR_UINT16) ; + GETNAME (GxB_LXOR_UINT32) ; + GETNAME (GxB_LXOR_UINT64) ; + GETNAME (GxB_LXOR_FP32) ; + GETNAME (GxB_LXOR_FP64) ; + + GETNAME (GrB_LXNOR) ; + + GETNAME (GxB_ATAN2_FP32) ; + GETNAME (GxB_ATAN2_FP64) ; + + GETNAME (GxB_HYPOT_FP32) ; + GETNAME (GxB_HYPOT_FP64) ; + + GETNAME (GxB_FMOD_FP32) ; + GETNAME (GxB_FMOD_FP64) ; + + GETNAME (GxB_REMAINDER_FP32) ; + GETNAME (GxB_REMAINDER_FP64) ; + + GETNAME (GxB_LDEXP_FP32) ; + GETNAME (GxB_LDEXP_FP64) ; + + GETNAME (GxB_COPYSIGN_FP32) ; + GETNAME (GxB_COPYSIGN_FP64) ; + + GETNAME (GrB_BOR_INT8) ; + GETNAME (GrB_BOR_INT16) ; + GETNAME (GrB_BOR_INT32) ; + GETNAME (GrB_BOR_INT64) ; + GETNAME (GrB_BOR_UINT8) ; + GETNAME (GrB_BOR_UINT16) ; + GETNAME (GrB_BOR_UINT32) ; + GETNAME (GrB_BOR_UINT64) ; + + GETNAME (GrB_BAND_INT8) ; + GETNAME (GrB_BAND_INT16) ; + GETNAME (GrB_BAND_INT32) ; + GETNAME (GrB_BAND_INT64) ; + GETNAME (GrB_BAND_UINT8) ; + GETNAME (GrB_BAND_UINT16) ; + GETNAME (GrB_BAND_UINT32) ; + GETNAME (GrB_BAND_UINT64) ; + + GETNAME (GrB_BXOR_INT8) ; + GETNAME (GrB_BXOR_INT16) ; + GETNAME (GrB_BXOR_INT32) ; + GETNAME (GrB_BXOR_INT64) ; + GETNAME (GrB_BXOR_UINT8) ; + GETNAME (GrB_BXOR_UINT16) ; + GETNAME (GrB_BXOR_UINT32) ; + GETNAME (GrB_BXOR_UINT64) ; + + GETNAME (GrB_BXNOR_INT8) ; + GETNAME (GrB_BXNOR_INT16) ; + GETNAME (GrB_BXNOR_INT32) ; + GETNAME (GrB_BXNOR_INT64) ; + GETNAME (GrB_BXNOR_UINT8) ; + GETNAME (GrB_BXNOR_UINT16) ; + GETNAME (GrB_BXNOR_UINT32) ; + GETNAME (GrB_BXNOR_UINT64) ; + + GETNAME (GxB_BGET_INT8) ; + GETNAME (GxB_BGET_INT16) ; + GETNAME (GxB_BGET_INT32) ; + GETNAME (GxB_BGET_INT64) ; + GETNAME (GxB_BGET_UINT8) ; + GETNAME (GxB_BGET_UINT16) ; + GETNAME (GxB_BGET_UINT32) ; + GETNAME (GxB_BGET_UINT64) ; + + GETNAME (GxB_BSET_INT8) ; + GETNAME (GxB_BSET_INT16) ; + GETNAME (GxB_BSET_INT32) ; + GETNAME (GxB_BSET_INT64) ; + GETNAME (GxB_BSET_UINT8) ; + GETNAME (GxB_BSET_UINT16) ; + GETNAME (GxB_BSET_UINT32) ; + GETNAME (GxB_BSET_UINT64) ; + + GETNAME (GxB_BCLR_INT8) ; + GETNAME (GxB_BCLR_INT16) ; + GETNAME (GxB_BCLR_INT32) ; + GETNAME (GxB_BCLR_INT64) ; + GETNAME (GxB_BCLR_UINT8) ; + GETNAME (GxB_BCLR_UINT16) ; + GETNAME (GxB_BCLR_UINT32) ; + GETNAME (GxB_BCLR_UINT64) ; + + GETNAME (GxB_BSHIFT_INT8) ; + GETNAME (GxB_BSHIFT_INT16) ; + GETNAME (GxB_BSHIFT_INT32) ; + GETNAME (GxB_BSHIFT_INT64) ; + GETNAME (GxB_BSHIFT_UINT8) ; + GETNAME (GxB_BSHIFT_UINT16) ; + GETNAME (GxB_BSHIFT_UINT32) ; + GETNAME (GxB_BSHIFT_UINT64) ; + + GETNAM2 (GrB_EQ_BOOL, "GrB_LXNOR") ; + GETNAME (GrB_EQ_INT8) ; + GETNAME (GrB_EQ_INT16) ; + GETNAME (GrB_EQ_INT32) ; + GETNAME (GrB_EQ_INT64) ; + GETNAME (GrB_EQ_UINT8) ; + GETNAME (GrB_EQ_UINT16) ; + GETNAME (GrB_EQ_UINT32) ; + GETNAME (GrB_EQ_UINT64) ; + GETNAME (GrB_EQ_FP32) ; + GETNAME (GrB_EQ_FP64) ; + GETNAME (GxB_EQ_FC32) ; + GETNAME (GxB_EQ_FC64) ; + + GETNAME (GrB_NE_BOOL) ; + GETNAME (GrB_NE_INT8) ; + GETNAME (GrB_NE_INT16) ; + GETNAME (GrB_NE_INT32) ; + GETNAME (GrB_NE_INT64) ; + GETNAME (GrB_NE_UINT8) ; + GETNAME (GrB_NE_UINT16) ; + GETNAME (GrB_NE_UINT32) ; + GETNAME (GrB_NE_UINT64) ; + GETNAME (GrB_NE_FP32) ; + GETNAME (GrB_NE_FP64) ; + GETNAME (GxB_NE_FC32) ; + GETNAME (GxB_NE_FC64) ; + + GETNAME (GrB_GT_BOOL) ; + GETNAME (GrB_GT_INT8) ; + GETNAME (GrB_GT_INT16) ; + GETNAME (GrB_GT_INT32) ; + GETNAME (GrB_GT_INT64) ; + GETNAME (GrB_GT_UINT8) ; + GETNAME (GrB_GT_UINT16) ; + GETNAME (GrB_GT_UINT32) ; + GETNAME (GrB_GT_UINT64) ; + GETNAME (GrB_GT_FP32) ; + GETNAME (GrB_GT_FP64) ; + + GETNAME (GrB_LT_BOOL) ; + GETNAME (GrB_LT_INT8) ; + GETNAME (GrB_LT_INT16) ; + GETNAME (GrB_LT_INT32) ; + GETNAME (GrB_LT_INT64) ; + GETNAME (GrB_LT_UINT8) ; + GETNAME (GrB_LT_UINT16) ; + GETNAME (GrB_LT_UINT32) ; + GETNAME (GrB_LT_UINT64) ; + GETNAME (GrB_LT_FP32) ; + GETNAME (GrB_LT_FP64) ; + + GETNAME (GrB_GE_BOOL) ; + GETNAME (GrB_GE_INT8) ; + GETNAME (GrB_GE_INT16) ; + GETNAME (GrB_GE_INT32) ; + GETNAME (GrB_GE_INT64) ; + GETNAME (GrB_GE_UINT8) ; + GETNAME (GrB_GE_UINT16) ; + GETNAME (GrB_GE_UINT32) ; + GETNAME (GrB_GE_UINT64) ; + GETNAME (GrB_GE_FP32) ; + GETNAME (GrB_GE_FP64) ; + + GETNAME (GrB_LE_BOOL) ; + GETNAME (GrB_LE_INT8) ; + GETNAME (GrB_LE_INT16) ; + GETNAME (GrB_LE_INT32) ; + GETNAME (GrB_LE_INT64) ; + GETNAME (GrB_LE_UINT8) ; + GETNAME (GrB_LE_UINT16) ; + GETNAME (GrB_LE_UINT32) ; + GETNAME (GrB_LE_UINT64) ; + GETNAME (GrB_LE_FP32) ; + GETNAME (GrB_LE_FP64) ; + + GETNAME (GxB_CMPLX_FP32) ; + GETNAME (GxB_CMPLX_FP64) ; + + GETNAME (GxB_FIRSTI_INT32) ; GETNAME (GxB_FIRSTI_INT64) ; + GETNAME (GxB_FIRSTI1_INT32) ; GETNAME (GxB_FIRSTI1_INT64) ; + GETNAME (GxB_FIRSTJ_INT32) ; GETNAME (GxB_FIRSTJ_INT64) ; + GETNAME (GxB_FIRSTJ1_INT32) ; GETNAME (GxB_FIRSTJ1_INT64) ; + GETNAME (GxB_SECONDI_INT32) ; GETNAME (GxB_SECONDI_INT64) ; + GETNAME (GxB_SECONDI1_INT32) ; GETNAME (GxB_SECONDI1_INT64) ; + GETNAME (GxB_SECONDJ_INT32) ; GETNAME (GxB_SECONDJ_INT64) ; + GETNAME (GxB_SECONDJ1_INT32) ; GETNAME (GxB_SECONDJ1_INT64) ; + + GETNAME (GxB_IGNORE_DUP) ; + + //-------------------------------------------------------------------------- + // other get/set methods for GrB_BinaryOp + //-------------------------------------------------------------------------- + + OK (GrB_BinaryOp_get_INT32_(GrB_MAX_FP32, &code, GrB_INP0_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_BinaryOp_get_SIZE_(GrB_MAX_FP32, &size, GrB_INP0_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + + OK (GrB_BinaryOp_get_String_(GrB_MAX_FP32, name, GrB_INP0_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_BinaryOp_get_SIZE_(GrB_MAX_INT32, &size, GrB_INP1_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_INT32") + 1) ; + + OK (GrB_BinaryOp_get_String_(GrB_MAX_INT32, name, GrB_INP1_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_INT32")) ; + + OK (GrB_BinaryOp_get_INT32_(GrB_MAX_FP64, &code, GrB_OUTP_TYPE_CODE)) ; + CHECK (code == GrB_FP64_CODE) ; + + OK (GrB_BinaryOp_get_SIZE_(GrB_MAX_FP64, &size, GrB_OUTP_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_FP64") + 1) ; + + OK (GrB_BinaryOp_get_String_(GrB_MAX_FP64, name, GrB_OUTP_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP64")) ; + + OK (GrB_BinaryOp_get_Scalar_(GrB_MAX_FP32, s_int32, GrB_INP0_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_BinaryOp_get_Scalar_(GrB_LAND, s_int32, GrB_OUTP_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_BOOL_CODE) ; + + OK (GrB_BinaryOp_get_INT32_(GrB_PLUS_FP64, &code, GrB_INP1_TYPE_CODE)) ; + CHECK (code == GrB_FP64_CODE) ; + + OK (GrB_BinaryOp_get_Scalar_(GrB_LAND, s_int32, GrB_INP1_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_BOOL_CODE) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_BinaryOp_get_INT32_(GrB_LAND, &code, GrB_NAME)) ; + ERR (GrB_BinaryOp_get_String_(GrB_MAX_INT32, name, 999)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_BinaryOp_get_VOID_(GrB_LAND, nothing, 0)) ; + + OK (GrB_BinaryOp_new (&binop, myfunc, GrB_FP32, GrB_FP32, GrB_FP32)) ; + OK (GrB_BinaryOp_get_SIZE_(binop, &size, GrB_NAME)) ; + CHECK (size == 1) ; + OK (GrB_BinaryOp_get_SIZE_(binop, &size, GxB_JIT_C_NAME)) ; + CHECK (size == 1) ; + OK (GrB_BinaryOp_get_SIZE_(binop, &size, GxB_JIT_C_DEFINITION)) ; + CHECK (size == 1) ; + OK (GrB_BinaryOp_set_String_(binop, "myfunc", GxB_JIT_C_NAME)) ; + OK (GrB_BinaryOp_get_String_(binop, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "myfunc")) ; + CHECK (binop->hash == UINT64_MAX) ; + METHOD (GrB_BinaryOp_set_String (binop, MYFUNC_DEFN, GxB_JIT_C_DEFINITION)) ; + OK (GrB_BinaryOp_get_String_(binop, defn, GxB_JIT_C_DEFINITION)) ; + CHECK (MATCH (defn, MYFUNC_DEFN)) ; + CHECK (binop->hash != UINT64_MAX) ; + OK (GxB_print (binop, 3)) ; + + OK (GrB_BinaryOp_set_String_(binop, "user name for myfunc", GrB_NAME)) ; + OK (GrB_BinaryOp_get_String_(binop, name, GrB_NAME)) ; + CHECK (MATCH (name, "user name for myfunc")) ; + expected = GrB_ALREADY_SET ; + ERR (GrB_BinaryOp_set_String_(binop, "another user name", GrB_NAME)) ; + printf (" test GrB_ALREADY_SET: ok\n") ; + + OK (GrB_BinaryOp_get_INT32_(binop, &code, GrB_INP1_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_BinaryOp_set_Scalar_(binop, s_int32, 0)) ; + ERR (GrB_BinaryOp_set_INT32_(binop, 0, 0)) ; + ERR (GrB_BinaryOp_set_VOID_(binop, nothing, 0, 0)) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GrB_free (&binop) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test28: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test29.c b/GraphBLAS/Test/GB_mex_test29.c new file mode 100644 index 0000000000..0ec8a45325 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test29.c @@ -0,0 +1,462 @@ +//------------------------------------------------------------------------------ +// GB_mex_test29: test GrB_get and GrB_set (global) +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test29" + +#define FREE_ALL ; +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +int myprintf (const char *restrict format, ...) ; + +int myprintf (const char *restrict format, ...) +{ + printf ("[[myprintf:") ; + va_list ap ; + va_start (ap, format) ; + vprintf (format, ap) ; + va_end (ap) ; + printf ("]]") ; + return (1) ; +} + +int myflush (void) ; + +int myflush (void) +{ + printf ("myflush\n") ; + fflush (stdout) ; + return (0) ; +} + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix A = NULL ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size ; + char name [256] ; + char defn [2048], defn2 [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + + //-------------------------------------------------------------------------- + // global set/get + //-------------------------------------------------------------------------- + + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GrB_LIBRARY_VER_MAJOR)) ; + CHECK (i == GxB_IMPLEMENTATION_MAJOR) ; + + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GrB_LIBRARY_VER_MINOR)) ; + CHECK (i == GxB_IMPLEMENTATION_MINOR) ; + + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GrB_LIBRARY_VER_PATCH)) ; + CHECK (i == GxB_IMPLEMENTATION_SUB) ; + + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GrB_API_VER_MAJOR)) ; + CHECK (i == GxB_SPEC_MAJOR) ; + + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GrB_API_VER_MINOR)) ; + CHECK (i == GxB_SPEC_MINOR) ; + + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GrB_API_VER_PATCH)) ; + CHECK (i == GxB_SPEC_SUB) ; + + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GrB_BLOCKING_MODE)) ; + CHECK (i == GrB_NONBLOCKING) ; + + i = -1 ; + 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)) ; + CHECK (i == GrB_COLMAJOR) ; + + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, GrB_ROWMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, + GrB_STORAGE_ORIENTATION_HINT)) ; + CHECK (i == GrB_ROWMAJOR) ; + + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, + GrB_STORAGE_ORIENTATION_HINT)) ; + CHECK (i == GrB_COLMAJOR) ; + + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, GrB_BOTH, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, + GrB_STORAGE_ORIENTATION_HINT)) ; + CHECK (i == GrB_ROWMAJOR) ; + + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, + GrB_STORAGE_ORIENTATION_HINT)) ; + CHECK (i == GrB_COLMAJOR) ; + + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, GrB_UNKNOWN, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, + GrB_STORAGE_ORIENTATION_HINT)) ; + CHECK (i == GrB_ROWMAJOR) ; + + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, + GrB_STORAGE_ORIENTATION_HINT)) ; + CHECK (i == GrB_COLMAJOR) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Global_set_INT32_ (GrB_GLOBAL, 999, + GrB_STORAGE_ORIENTATION_HINT)) ; + + 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, GxB_GLOBAL_NTHREADS)) ; + printf ("nthreads: %d\n", nth) ; + 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, GxB_GLOBAL_NTHREADS)) ; + + int32_t gpu ; + 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, 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, GxB_GLOBAL_GPU_ID)) ; + + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GxB_BURBLE)) ; + printf ("burble: %d\n", i) ; + 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, 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, GxB_LIBRARY_OPENMP)) ; + CHECK (i == 1) ; + + int32_t onebase ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &onebase, GxB_PRINT_1BASED)) ; + printf ("1based: %d\n", i) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, GxB_PRINT_1BASED)) ; + OK (GxB_print (A, 2)) ; + 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, 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, 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, GxB_JIT_C_CONTROL)) ; + + int32_t 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, 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, GxB_JIT_USE_CMAKE)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, GrB_BLOCKING_MODE)) ; + expected = GrB_EMPTY_OBJECT ; + ERR (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_int32, + GrB_STORAGE_ORIENTATION_HINT)) ; + expected = GrB_INVALID_VALUE ; + 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, GxB_JIT_C_CONTROL)) ; + OK (GrB_Scalar_setElement_INT32 (s_int32, 2)) ; + 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, 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, 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, GxB_HYPER_SWITCH)) ; + OK (GrB_Scalar_clear (s_fp64)) ; + 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, GxB_HYPER_SWITCH)) ; + OK (GrB_Scalar_clear (s_fp64)) ; + + 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, GxB_CHUNK)) ; + OK (GrB_Scalar_clear (s_fp64)) ; + OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, GxB_CHUNK)) ; + OK (GrB_Scalar_extractElement (&dvalue, s_fp64)) ; + CHECK (dvalue == 8901) ; + + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, GrB_EL_TYPE_CODE)) ; + ERR (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GrB_EL_TYPE_CODE)) ; + ERR (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GrB_EL_TYPE_CODE)) ; + ERR (GrB_Global_get_String_ (GrB_GLOBAL, name, GrB_EL_TYPE_CODE)) ; + ERR (GrB_Global_get_VOID_ (GrB_GLOBAL, nothing, GrB_EL_TYPE_CODE)) ; + + OK (GrB_Global_get_String_ (GrB_GLOBAL, name, GrB_NAME)) ; + printf ("library name: [%s]\n", name) ; + CHECK (MATCH (name, GxB_IMPLEMENTATION_NAME)) ; + + name [0] = 0 ; + 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, GxB_LIBRARY_DATE)) ; + printf ("library date: [%s]\n", name) ; + + 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, GxB_LIBRARY_LICENSE)) ; + printf ("library license: [%s]\n", defn) ; + CHECK (MATCH (defn, GxB_IMPLEMENTATION_LICENSE)) ; + + 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, GxB_LIBRARY_COMPILE_TIME)) ; + printf ("library compile time: [%s]\n", name) ; + + 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, GxB_API_DATE)) ; + printf ("api date: [%s]\n", name) ; + + 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, GxB_API_URL)) ; + printf ("api url: [%s]\n", 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, GxB_JIT_C_COMPILER_NAME)) ; + printf ("JIT C compiler: [%s]\n", defn) ; + 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, 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, GxB_JIT_C_COMPILER_FLAGS)) ; + printf ("JIT C compiler flags: [%s]\n", defn) ; + 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, 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, GxB_JIT_C_LINKER_FLAGS)) ; + printf ("JIT C link flags: [%s]\n", defn) ; + 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, 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, GxB_JIT_C_LIBRARIES)) ; + printf ("JIT C libraries: [%s]\n", defn) ; + 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, 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, GxB_JIT_C_CMAKE_LIBS)) ; + printf ("JIT C cmake libs: [%s]\n", defn) ; + 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, 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, GxB_JIT_C_PREFACE)) ; + printf ("JIT C preface: [%s]\n", defn) ; + 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, 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, GxB_JIT_ERROR_LOG)) ; + printf ("JIT error log: [%s]\n", defn) ; + 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, 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, GxB_JIT_CACHE_PATH)) ; + printf ("JIT cache: [%s]\n", defn) ; + 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, 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") ; + + ERR (GrB_Global_set_String_ (GrB_GLOBAL, defn, GrB_NAME)) ; + + 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, GxB_BITMAP_SWITCH)) ; + CHECK (size == sizeof (double) * GxB_NBITMAP_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, GxB_BITMAP_SWITCH, + size)) ; + memset (sw, 0, size) ; + 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, GxB_BITMAP_SWITCH, + 0)) ; + 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, GxB_BITMAP_SWITCH, + 1)) ; + + ERR (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, 0, 0)) ; + + 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, GxB_FLUSH, + sizeof (GB_flush_function_t))) ; + OK (GxB_print (s_int32, 3)) ; + 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, 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, GxB_COMPILER_VERSION)) ; + CHECK (size == sizeof (int32_t) * 3) ; + OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) cv, + GxB_COMPILER_VERSION)) ; + + for (int k = 0 ; k < 3 ; k++) + { + printf ("compiler version [%d] = %d\n", k, cv [k]) ; + } + + void *f = NULL ; + OK (GrB_Global_get_VOID_(GrB_GLOBAL, (void *) &f, GxB_MALLOC_FUNCTION)) ; + CHECK (f == mxMalloc) ; + OK (GrB_Global_get_VOID_(GrB_GLOBAL, (void *) &f, GxB_REALLOC_FUNCTION)) ; + CHECK (f == mxRealloc) ; + OK (GrB_Global_get_VOID (GrB_GLOBAL, (void *) &f, GxB_CALLOC_FUNCTION)) ; + CHECK (f == mxCalloc) ; + OK (GrB_Global_get_VOID (GrB_GLOBAL, (void *) &f, GxB_FREE_FUNCTION)) ; + CHECK (f == mxFree) ; + + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_MALLOC_FUNCTION)) ; + CHECK (size == sizeof (void *)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_REALLOC_FUNCTION)) ; + CHECK (size == sizeof (void *)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_CALLOC_FUNCTION)) ; + CHECK (size == sizeof (void *)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_FREE_FUNCTION)) ; + CHECK (size == sizeof (void *)) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GrB_free (&A) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test29: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test30.c b/GraphBLAS/Test/GB_mex_test30.c new file mode 100644 index 0000000000..2ca9209a69 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test30.c @@ -0,0 +1,286 @@ +//------------------------------------------------------------------------------ +// GB_mex_test30: test GrB_get and GrB_set (index unary ops) +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test30" + +#define FREE_ALL ; +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +#define GETOP(op,opname) \ +{ \ + 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, GxB_JIT_C_NAME)) ; \ + printf ("%s: %s\n", name, cname) ; \ + OK (GrB_IndexUnaryOp_get_SIZE (op, &size, GrB_NAME)) ; \ + CHECK (size == strlen (name) + 1) ; \ + GrB_Info info2, info3 ; \ + info2 = GrB_IndexUnaryOp_get_SIZE (op, &siz1, GrB_INP0_TYPE_STRING) ; \ + info3 = GrB_IndexUnaryOp_get_String (op, name, GrB_INP0_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz1 == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (siz1 == 1) ; } \ + info2 = GrB_IndexUnaryOp_get_SIZE (op, &siz2, GrB_INP1_TYPE_STRING) ; \ + info3 = GrB_IndexUnaryOp_get_String (op, name, GrB_INP1_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz2 == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (siz2 == 1) ; } \ + info2 = GrB_IndexUnaryOp_get_SIZE (op, &siz3, GrB_OUTP_TYPE_STRING) ; \ + info3 = GrB_IndexUnaryOp_get_String (op, name, GrB_OUTP_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz3 == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (siz3 == 1) ; } \ +} + +#define GETNAME(op) \ +{ \ + GETOP (op, #op) ; \ +/* OK (GxB_IndexUnaryOp_fprint (op, "idxop", 3, NULL)) ; */\ +} + +void myfunc (bool *z, const float *x, GrB_Index i, GrB_Index j, + const float *y) ; +void myfunc (bool *z, const float *x, GrB_Index i, GrB_Index j, + const float *y) +{ + (*z) = (*x) > 2 ; +} + +#define MYFUNC_DEFN \ +"void myfunc (bool *z, const float *x, GrB_Index i, GrB_Index j, \n" \ +" const float *y) \n" \ +"{ \n" \ +" (*z) = (*x) > 2 ; \n" \ +"}" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL ; + GrB_IndexUnaryOp op = NULL ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size ; + char name [256] ; + char cname [256] ; + char defn [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + + //-------------------------------------------------------------------------- + // GrB_IndexUnaryOp get name + //-------------------------------------------------------------------------- + + GETNAME (GrB_ROWINDEX_INT32) ; + GETNAME (GrB_ROWINDEX_INT64) ; + GETNAME (GrB_COLINDEX_INT32) ; + GETNAME (GrB_COLINDEX_INT64) ; + GETNAME (GrB_DIAGINDEX_INT32) ; + GETNAME (GrB_DIAGINDEX_INT64) ; + + GETNAME (GxB_FLIPDIAGINDEX_INT32) ; + GETNAME (GxB_FLIPDIAGINDEX_INT64) ; + + GETNAME (GrB_TRIL) ; + GETNAME (GrB_TRIU) ; + GETNAME (GrB_DIAG) ; + GETNAME (GrB_OFFDIAG) ; + + GETNAME (GrB_COLLE) ; + GETNAME (GrB_COLGT) ; + GETNAME (GrB_ROWLE) ; + GETNAME (GrB_ROWGT) ; + + GETNAME (GrB_VALUEEQ_BOOL) ; + GETNAME (GrB_VALUEEQ_INT8) ; + GETNAME (GrB_VALUEEQ_INT16) ; + GETNAME (GrB_VALUEEQ_INT32) ; + GETNAME (GrB_VALUEEQ_INT64) ; + GETNAME (GrB_VALUEEQ_UINT8) ; + GETNAME (GrB_VALUEEQ_UINT16) ; + GETNAME (GrB_VALUEEQ_UINT32) ; + GETNAME (GrB_VALUEEQ_UINT64) ; + GETNAME (GrB_VALUEEQ_FP32) ; + GETNAME (GrB_VALUEEQ_FP64) ; + GETNAME (GxB_VALUEEQ_FC32) ; + GETNAME (GxB_VALUEEQ_FC64) ; + + GETNAME (GrB_VALUENE_BOOL) ; + GETNAME (GrB_VALUENE_INT8) ; + GETNAME (GrB_VALUENE_INT16) ; + GETNAME (GrB_VALUENE_INT32) ; + GETNAME (GrB_VALUENE_INT64) ; + GETNAME (GrB_VALUENE_UINT8) ; + GETNAME (GrB_VALUENE_UINT16) ; + GETNAME (GrB_VALUENE_UINT32) ; + GETNAME (GrB_VALUENE_UINT64) ; + GETNAME (GrB_VALUENE_FP32) ; + GETNAME (GrB_VALUENE_FP64) ; + GETNAME (GxB_VALUENE_FC32) ; + GETNAME (GxB_VALUENE_FC64) ; + + GETNAME (GrB_VALUELT_BOOL) ; + GETNAME (GrB_VALUELT_INT8) ; + GETNAME (GrB_VALUELT_INT16) ; + GETNAME (GrB_VALUELT_INT32) ; + GETNAME (GrB_VALUELT_INT64) ; + GETNAME (GrB_VALUELT_UINT8) ; + GETNAME (GrB_VALUELT_UINT16) ; + GETNAME (GrB_VALUELT_UINT32) ; + GETNAME (GrB_VALUELT_UINT64) ; + GETNAME (GrB_VALUELT_FP32) ; + GETNAME (GrB_VALUELT_FP64) ; + + GETNAME (GrB_VALUELE_BOOL) ; + GETNAME (GrB_VALUELE_INT8) ; + GETNAME (GrB_VALUELE_INT16) ; + GETNAME (GrB_VALUELE_INT32) ; + GETNAME (GrB_VALUELE_INT64) ; + GETNAME (GrB_VALUELE_UINT8) ; + GETNAME (GrB_VALUELE_UINT16) ; + GETNAME (GrB_VALUELE_UINT32) ; + GETNAME (GrB_VALUELE_UINT64) ; + GETNAME (GrB_VALUELE_FP32) ; + GETNAME (GrB_VALUELE_FP64) ; + + GETNAME (GrB_VALUEGT_BOOL) ; + GETNAME (GrB_VALUEGT_INT8) ; + GETNAME (GrB_VALUEGT_INT16) ; + GETNAME (GrB_VALUEGT_INT32) ; + GETNAME (GrB_VALUEGT_INT64) ; + GETNAME (GrB_VALUEGT_UINT8) ; + GETNAME (GrB_VALUEGT_UINT16) ; + GETNAME (GrB_VALUEGT_UINT32) ; + GETNAME (GrB_VALUEGT_UINT64) ; + GETNAME (GrB_VALUEGT_FP32) ; + GETNAME (GrB_VALUEGT_FP64) ; + + GETNAME (GrB_VALUEGE_BOOL) ; + GETNAME (GrB_VALUEGE_INT8) ; + GETNAME (GrB_VALUEGE_INT16) ; + GETNAME (GrB_VALUEGE_INT32) ; + GETNAME (GrB_VALUEGE_INT64) ; + GETNAME (GrB_VALUEGE_UINT8) ; + GETNAME (GrB_VALUEGE_UINT16) ; + GETNAME (GrB_VALUEGE_UINT32) ; + GETNAME (GrB_VALUEGE_UINT64) ; + GETNAME (GrB_VALUEGE_FP32) ; + GETNAME (GrB_VALUEGE_FP64) ; + + GETNAME (GxB_NONZOMBIE) ; + + //-------------------------------------------------------------------------- + // other get/set methods for GrB_IndexUnaryOp + //-------------------------------------------------------------------------- + + OK (GrB_IndexUnaryOp_get_INT32_(GrB_VALUEGE_FP32, &code, GrB_INP0_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_IndexUnaryOp_get_String_(GrB_VALUEGE_FP32, name, GrB_INP0_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_IndexUnaryOp_get_INT32_(GrB_VALUEGE_FP64, &code, GrB_OUTP_TYPE_CODE)) ; + CHECK (code == GrB_BOOL_CODE) ; + + OK (GrB_IndexUnaryOp_get_String_(GrB_VALUEGE_FP64, name, GrB_OUTP_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_BOOL")) ; + + OK (GrB_IndexUnaryOp_get_Scalar_(GrB_VALUEGE_FP32, s_int32, GrB_INP0_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_IndexUnaryOp_get_Scalar_(GrB_VALUEGE_FP32, s_int32, GrB_OUTP_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_BOOL_CODE) ; + + expected = GrB_NO_VALUE ; + ERR (GrB_IndexUnaryOp_get_INT32_(GrB_TRIL, &code, GrB_INP0_TYPE_CODE)) ; + ERR (GrB_IndexUnaryOp_get_Scalar_(GrB_TRIL, s_int32, GrB_INP0_TYPE_CODE)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_IndexUnaryOp_get_INT32_(GrB_TRIL, &code, GrB_NAME)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_IndexUnaryOp_get_VOID_(GrB_TRIL, nothing, 0)) ; + + OK (GrB_IndexUnaryOp_new (&op, myfunc, GrB_BOOL, GrB_FP32, GrB_FP32)) ; + OK (GrB_IndexUnaryOp_get_SIZE_(op, &size, GrB_NAME)) ; + CHECK (size == 1) ; + OK (GrB_IndexUnaryOp_get_SIZE_(op, &size, GxB_JIT_C_NAME)) ; + printf ("size %lu\n", size) ; + CHECK (size == 1) ; + OK (GrB_IndexUnaryOp_get_SIZE_(op, &size, GxB_JIT_C_DEFINITION)) ; + CHECK (size == 1) ; + + expected = GrB_INVALID_VALUE ; + OK (GrB_IndexUnaryOp_set_String_(op, "myfunc", GxB_JIT_C_NAME)) ; + OK (GrB_IndexUnaryOp_get_String_(op, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "myfunc")) ; + CHECK (op->hash == UINT64_MAX) ; + METHOD (GrB_IndexUnaryOp_set_String (op, MYFUNC_DEFN, GxB_JIT_C_DEFINITION)) ; + OK (GrB_IndexUnaryOp_get_String_(op, defn, GxB_JIT_C_DEFINITION)) ; + CHECK (MATCH (defn, MYFUNC_DEFN)) ; + CHECK (op->hash != UINT64_MAX) ; + OK (GxB_print (op, 3)) ; + + OK (GrB_IndexUnaryOp_set_String_(op, "user name for myfunc", GrB_NAME)) ; + OK (GrB_IndexUnaryOp_get_String_(op, name, GrB_NAME)) ; + CHECK (MATCH (name, "user name for myfunc")) ; + expected = GrB_ALREADY_SET ; + ERR (GrB_IndexUnaryOp_set_String_(op, "another user name", GrB_NAME)) ; + printf (" test GrB_ALREADY_SET: ok\n") ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_IndexUnaryOp_set_String_(op, "another_name", 999)) ; + ERR (GrB_IndexUnaryOp_get_SIZE(op, &size, 999)) ; + + expected = GrB_ALREADY_SET ; + ERR (GrB_IndexUnaryOp_set_String_(op, "another_name", GxB_JIT_C_NAME)) ; + ERR (GrB_IndexUnaryOp_set_String_(op, "another_defn", GxB_JIT_C_DEFINITION)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_IndexUnaryOp_set_String_(GrB_LNOT, "newname", GxB_JIT_C_NAME)) ; + ERR (GrB_IndexUnaryOp_set_Scalar_(op, s_int32, 0)) ; + ERR (GrB_IndexUnaryOp_set_INT32_(op, 0, 0)) ; + ERR (GrB_IndexUnaryOp_set_VOID_(op, nothing, 0, 0)) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GrB_free (&op) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test30: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test31.c b/GraphBLAS/Test/GB_mex_test31.c new file mode 100644 index 0000000000..53754b679c --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test31.c @@ -0,0 +1,381 @@ +//------------------------------------------------------------------------------ +// GB_mex_test31: test GrB_get and GrB_set (monoids) +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test31" + +#define FREE_ALL ; +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +#define GETOP(op,opname) \ +{ \ + size_t siz1, siz2, siz3 ; \ + OK (GrB_Monoid_get_String (op, name, GrB_NAME)) ; \ + CHECK (MATCH (name, opname)) ; \ + OK (GrB_Monoid_get_SIZE (op, &size, GrB_NAME)) ; \ + CHECK (size == strlen (name) + 1) ; \ + GrB_Info info2, info3 ; \ + info2 = GrB_Monoid_get_SIZE (op, &siz1, GrB_INP0_TYPE_STRING) ; \ + info3 = GrB_Monoid_get_String (op, name, GrB_INP0_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz1 == strlen (name) + 1) ; \ + CHECK (info2 == GrB_SUCCESS) ; \ + info2 = GrB_Monoid_get_SIZE (op, &siz2, GrB_INP1_TYPE_STRING) ; \ + info3 = GrB_Monoid_get_String (op, name, GrB_INP1_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz2 == strlen (name) + 1) ; \ + CHECK (info2 == GrB_SUCCESS) ; \ + info2 = GrB_Monoid_get_SIZE (op, &siz3, GrB_OUTP_TYPE_STRING) ; \ + info3 = GrB_Monoid_get_String (op, name, GrB_OUTP_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz3 == strlen (name) + 1) ; \ + CHECK (info2 == GrB_SUCCESS) ; \ +} + +#define GETNAME(op) \ +{ \ + GETOP (op, #op) ; \ +/* OK (GxB_Monoid_fprint (op, "binop", 3, NULL)) ; */ \ +} + +#define GETNAM2(op,alias) \ +{ \ + GETOP (op,alias) ; \ +/* OK (GxB_Monoid_fprint (op, "binop", 3, NULL)) ; */ \ +} + +void myfunc (float *z, const float *x, const float *y) ; +void myfunc (float *z, const float *x, const float *y) { (*z) = (*x)+(*y) ; } +#define MYFUNC_DEFN \ +"void myfunc (float *z, const float *x, const float *y) { (*z) = (*x)+(*y) ; }" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL ; + GrB_BinaryOp binop = NULL, op = NULL ; + GrB_Monoid monoid = NULL ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size ; + char name [256] ; + char defn [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + GrB_Index nvals = 999 ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + + //-------------------------------------------------------------------------- + // GrB_Monoid get name + //-------------------------------------------------------------------------- + + GETNAM2 (GxB_MIN_INT8_MONOID, "GrB_MIN_MONOID_INT8") ; + GETNAM2 (GxB_MIN_INT16_MONOID, "GrB_MIN_MONOID_INT16") ; + GETNAM2 (GxB_MIN_INT32_MONOID, "GrB_MIN_MONOID_INT32") ; + GETNAM2 (GxB_MIN_INT64_MONOID, "GrB_MIN_MONOID_INT64") ; + GETNAM2 (GxB_MIN_UINT8_MONOID, "GrB_MIN_MONOID_UINT8") ; + GETNAM2 (GxB_MIN_UINT16_MONOID, "GrB_MIN_MONOID_UINT16") ; + GETNAM2 (GxB_MIN_UINT32_MONOID, "GrB_MIN_MONOID_UINT32") ; + GETNAM2 (GxB_MIN_UINT64_MONOID, "GrB_MIN_MONOID_UINT64") ; + GETNAM2 (GxB_MIN_FP32_MONOID, "GrB_MIN_MONOID_FP32") ; + GETNAM2 (GxB_MIN_FP64_MONOID, "GrB_MIN_MONOID_FP64") ; + + GETNAME (GrB_MIN_MONOID_INT8) ; + GETNAME (GrB_MIN_MONOID_INT16) ; + GETNAME (GrB_MIN_MONOID_INT32) ; + GETNAME (GrB_MIN_MONOID_INT64) ; + GETNAME (GrB_MIN_MONOID_UINT8) ; + GETNAME (GrB_MIN_MONOID_UINT16) ; + GETNAME (GrB_MIN_MONOID_UINT32) ; + GETNAME (GrB_MIN_MONOID_UINT64) ; + GETNAME (GrB_MIN_MONOID_FP32) ; + GETNAME (GrB_MIN_MONOID_FP64) ; + + GETNAM2 (GxB_MAX_INT8_MONOID, "GrB_MAX_MONOID_INT8") ; + GETNAM2 (GxB_MAX_INT16_MONOID, "GrB_MAX_MONOID_INT16") ; + GETNAM2 (GxB_MAX_INT32_MONOID, "GrB_MAX_MONOID_INT32") ; + GETNAM2 (GxB_MAX_INT64_MONOID, "GrB_MAX_MONOID_INT64") ; + GETNAM2 (GxB_MAX_UINT8_MONOID, "GrB_MAX_MONOID_UINT8") ; + GETNAM2 (GxB_MAX_UINT16_MONOID, "GrB_MAX_MONOID_UINT16") ; + GETNAM2 (GxB_MAX_UINT32_MONOID, "GrB_MAX_MONOID_UINT32") ; + GETNAM2 (GxB_MAX_UINT64_MONOID, "GrB_MAX_MONOID_UINT64") ; + GETNAM2 (GxB_MAX_FP32_MONOID, "GrB_MAX_MONOID_FP32") ; + GETNAM2 (GxB_MAX_FP64_MONOID, "GrB_MAX_MONOID_FP64") ; + + GETNAME (GrB_MAX_MONOID_INT8) ; + GETNAME (GrB_MAX_MONOID_INT16) ; + GETNAME (GrB_MAX_MONOID_INT32) ; + GETNAME (GrB_MAX_MONOID_INT64) ; + GETNAME (GrB_MAX_MONOID_UINT8) ; + GETNAME (GrB_MAX_MONOID_UINT16) ; + GETNAME (GrB_MAX_MONOID_UINT32) ; + GETNAME (GrB_MAX_MONOID_UINT64) ; + GETNAME (GrB_MAX_MONOID_FP32) ; + GETNAME (GrB_MAX_MONOID_FP64) ; + + GETNAM2 (GxB_PLUS_INT8_MONOID, "GrB_PLUS_MONOID_INT8") ; + GETNAM2 (GxB_PLUS_INT16_MONOID, "GrB_PLUS_MONOID_INT16") ; + GETNAM2 (GxB_PLUS_INT32_MONOID, "GrB_PLUS_MONOID_INT32") ; + GETNAM2 (GxB_PLUS_INT64_MONOID, "GrB_PLUS_MONOID_INT64") ; + GETNAM2 (GxB_PLUS_UINT8_MONOID, "GrB_PLUS_MONOID_UINT8") ; + GETNAM2 (GxB_PLUS_UINT16_MONOID, "GrB_PLUS_MONOID_UINT16") ; + GETNAM2 (GxB_PLUS_UINT32_MONOID, "GrB_PLUS_MONOID_UINT32") ; + GETNAM2 (GxB_PLUS_UINT64_MONOID, "GrB_PLUS_MONOID_UINT64") ; + GETNAM2 (GxB_PLUS_FP32_MONOID, "GrB_PLUS_MONOID_FP32") ; + GETNAM2 (GxB_PLUS_FP64_MONOID, "GrB_PLUS_MONOID_FP64") ; + GETNAME (GxB_PLUS_FC32_MONOID) ; + GETNAME (GxB_PLUS_FC64_MONOID) ; + + GETNAME (GrB_PLUS_MONOID_INT8) ; + GETNAME (GrB_PLUS_MONOID_INT16) ; + GETNAME (GrB_PLUS_MONOID_INT32) ; + GETNAME (GrB_PLUS_MONOID_INT64) ; + GETNAME (GrB_PLUS_MONOID_UINT8) ; + GETNAME (GrB_PLUS_MONOID_UINT16) ; + GETNAME (GrB_PLUS_MONOID_UINT32) ; + GETNAME (GrB_PLUS_MONOID_UINT64) ; + GETNAME (GrB_PLUS_MONOID_FP32) ; + GETNAME (GrB_PLUS_MONOID_FP64) ; + + GETNAM2 (GxB_TIMES_INT8_MONOID, "GrB_TIMES_MONOID_INT8") ; + GETNAM2 (GxB_TIMES_INT16_MONOID, "GrB_TIMES_MONOID_INT16") ; + GETNAM2 (GxB_TIMES_INT32_MONOID, "GrB_TIMES_MONOID_INT32") ; + GETNAM2 (GxB_TIMES_INT64_MONOID, "GrB_TIMES_MONOID_INT64") ; + GETNAM2 (GxB_TIMES_UINT8_MONOID, "GrB_TIMES_MONOID_UINT8") ; + GETNAM2 (GxB_TIMES_UINT16_MONOID, "GrB_TIMES_MONOID_UINT16") ; + GETNAM2 (GxB_TIMES_UINT32_MONOID, "GrB_TIMES_MONOID_UINT32") ; + GETNAM2 (GxB_TIMES_UINT64_MONOID, "GrB_TIMES_MONOID_UINT64") ; + GETNAM2 (GxB_TIMES_FP32_MONOID, "GrB_TIMES_MONOID_FP32") ; + GETNAM2 (GxB_TIMES_FP64_MONOID, "GrB_TIMES_MONOID_FP64") ; + GETNAME (GxB_TIMES_FC32_MONOID) ; + GETNAME (GxB_TIMES_FC64_MONOID) ; + + GETNAME (GrB_TIMES_MONOID_INT8) ; + GETNAME (GrB_TIMES_MONOID_INT16) ; + GETNAME (GrB_TIMES_MONOID_INT32) ; + GETNAME (GrB_TIMES_MONOID_INT64) ; + GETNAME (GrB_TIMES_MONOID_UINT8) ; + GETNAME (GrB_TIMES_MONOID_UINT16) ; + GETNAME (GrB_TIMES_MONOID_UINT32) ; + GETNAME (GrB_TIMES_MONOID_UINT64) ; + GETNAME (GrB_TIMES_MONOID_FP32) ; + GETNAME (GrB_TIMES_MONOID_FP64) ; + + GETNAME (GxB_ANY_BOOL_MONOID) ; + GETNAME (GxB_ANY_INT8_MONOID) ; + GETNAME (GxB_ANY_INT16_MONOID) ; + GETNAME (GxB_ANY_INT32_MONOID) ; + GETNAME (GxB_ANY_INT64_MONOID) ; + GETNAME (GxB_ANY_UINT8_MONOID) ; + GETNAME (GxB_ANY_UINT16_MONOID) ; + GETNAME (GxB_ANY_UINT32_MONOID) ; + GETNAME (GxB_ANY_UINT64_MONOID) ; + GETNAME (GxB_ANY_FP32_MONOID) ; + GETNAME (GxB_ANY_FP64_MONOID) ; + GETNAME (GxB_ANY_FC32_MONOID) ; + GETNAME (GxB_ANY_FC64_MONOID) ; + + GETNAM2 (GxB_LOR_BOOL_MONOID, "GrB_LOR_MONOID_BOOL") ; + GETNAM2 (GxB_LAND_BOOL_MONOID, "GrB_LAND_MONOID_BOOL") ; + GETNAM2 (GxB_LXOR_BOOL_MONOID, "GrB_LXOR_MONOID_BOOL") ; + GETNAM2 (GxB_LXNOR_BOOL_MONOID, "GrB_LXNOR_MONOID_BOOL") ; + GETNAM2 (GxB_EQ_BOOL_MONOID, "GrB_LXNOR_MONOID_BOOL") ; + + GETNAME (GrB_LOR_MONOID_BOOL) ; + GETNAME (GrB_LAND_MONOID_BOOL) ; + GETNAME (GrB_LXOR_MONOID_BOOL) ; + GETNAME (GrB_LXNOR_MONOID_BOOL) ; + + GETNAME (GxB_BOR_UINT8_MONOID) ; + GETNAME (GxB_BOR_UINT16_MONOID) ; + GETNAME (GxB_BOR_UINT32_MONOID) ; + GETNAME (GxB_BOR_UINT64_MONOID) ; + + GETNAME (GxB_BAND_UINT8_MONOID) ; + GETNAME (GxB_BAND_UINT16_MONOID) ; + GETNAME (GxB_BAND_UINT32_MONOID) ; + GETNAME (GxB_BAND_UINT64_MONOID) ; + + GETNAME (GxB_BXOR_UINT8_MONOID) ; + GETNAME (GxB_BXOR_UINT16_MONOID) ; + GETNAME (GxB_BXOR_UINT32_MONOID) ; + GETNAME (GxB_BXOR_UINT64_MONOID) ; + + GETNAME (GxB_BXNOR_UINT8_MONOID) ; + GETNAME (GxB_BXNOR_UINT16_MONOID) ; + GETNAME (GxB_BXNOR_UINT32_MONOID) ; + GETNAME (GxB_BXNOR_UINT64_MONOID) ; + + //-------------------------------------------------------------------------- + // other get/set methods for GrB_Monoid + //-------------------------------------------------------------------------- + + OK (GrB_Monoid_get_INT32_(GrB_MAX_MONOID_FP32, &code, GrB_INP0_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_Monoid_get_String_(GrB_MAX_MONOID_FP32, name, + GrB_INP0_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_Monoid_get_String_(GrB_MAX_MONOID_INT32, name, + GrB_INP1_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_INT32")) ; + + OK (GrB_Monoid_get_INT32_(GrB_MAX_MONOID_FP64, &code, GrB_OUTP_TYPE_CODE)) ; + CHECK (code == GrB_FP64_CODE) ; + + OK (GrB_Monoid_get_String_(GrB_MAX_MONOID_FP64, name, + GrB_OUTP_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP64")) ; + + OK (GrB_Monoid_get_Scalar_(GrB_MAX_MONOID_FP32, s_int32, + GrB_INP0_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_Monoid_get_Scalar_(GrB_LAND_MONOID_BOOL, s_int32, + GrB_OUTP_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_BOOL_CODE) ; + + OK (GrB_Monoid_get_INT32_(GrB_PLUS_MONOID_FP64, &code, + GrB_INP1_TYPE_CODE)) ; + CHECK (code == GrB_FP64_CODE) ; + + OK (GrB_Monoid_get_Scalar_(GrB_LAND_MONOID_BOOL, s_int32, + GrB_INP1_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_BOOL_CODE) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Monoid_get_INT32_(GrB_LAND_MONOID_BOOL, &code, GrB_NAME)) ; + ERR (GrB_Monoid_get_String_(GrB_MAX_MONOID_INT32, name, 999)) ; + ERR (GrB_Monoid_get_VOID_(GrB_LAND_MONOID_BOOL, nothing, 0)) ; + + OK (GrB_BinaryOp_new (&binop, 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)) ; + + OK (GrB_Monoid_new_FP32 (&monoid, binop, (float) 0.0)) ; + OK (GrB_Monoid_get_SIZE_(monoid, &size, GrB_NAME)) ; + OK (GrB_Monoid_get_String_(monoid, name, GrB_NAME)) ; + printf ("\nuser monoid: [%s]\n", name) ; + CHECK (MATCH (name, "")) ; + CHECK (size == 1) ; + OK (GxB_print (monoid, 3)) ; + + OK (GrB_Monoid_get_String_(monoid, name, GrB_INP0_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_Monoid_get_SIZE_(monoid, &size, GrB_INP0_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Monoid_get_SIZE_(monoid, &size, GrB_INP0_TYPE_CODE)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Monoid_set_Scalar_(monoid, s_int32, 0)) ; + ERR (GrB_Monoid_set_INT32_(monoid, 0, 0)) ; + ERR (GrB_Monoid_set_VOID_(monoid, nothing, 0, 0)) ; + + OK (GrB_Monoid_set_String_(monoid, "monoid_stuff", GrB_NAME)) ; + OK (GrB_Monoid_get_String_(monoid, name, GrB_NAME)) ; + printf ("\nuser monoid: [%s]\n", name) ; + CHECK (MATCH (name, "monoid_stuff")) ; + OK (GrB_Monoid_get_SIZE_(monoid, &size, GrB_NAME)) ; + CHECK (size == strlen (name) + 1) ; + + expected = GrB_ALREADY_SET ; + ERR (GrB_Monoid_set_String_(monoid, "another user name", GrB_NAME)) ; + printf (" test GrB_ALREADY_SET: ok\n") ; + + printf ("\nterminal monoid:\n") ; + int32_t id_int32 ; + OK (GxB_print (GrB_MAX_MONOID_INT32, 3)) ; + OK (GrB_Monoid_get_Scalar_ (GrB_MAX_MONOID_INT32, s_int32, + GxB_MONOID_IDENTITY)) ; + OK (GrB_Scalar_nvals (&nvals, s_int32)) ; + CHECK (nvals == 1) ; + OK (GrB_Scalar_extractElement_INT32_(&id_int32, s_int32)) ; + CHECK (id_int32 == INT32_MIN) ; + + int32_t term_int32 ; + OK (GrB_Monoid_get_Scalar_ (GrB_MAX_MONOID_INT32, s_int32, + GxB_MONOID_TERMINAL)) ; + OK (GrB_Scalar_extractElement_INT32_(&term_int32, s_int32)) ; + CHECK (term_int32 == INT32_MAX) ; + + printf ("\nmon-terminal monoid:\n") ; + OK (GxB_print (GrB_PLUS_MONOID_INT32, 3)) ; + OK (GrB_Monoid_get_Scalar_ (GrB_PLUS_MONOID_INT32, s_int32, + GxB_MONOID_TERMINAL)) ; + OK (GrB_Scalar_nvals (&nvals, s_int32)) ; + CHECK (nvals == 0) ; + + OK (GrB_Monoid_get_Scalar_ (GrB_PLUS_MONOID_INT32, s_int32, + GxB_MONOID_IDENTITY)) ; + OK (GrB_Scalar_extractElement_INT32_(&id_int32, s_int32)) ; + CHECK (id_int32 == 0) ; + + expected = GrB_DOMAIN_MISMATCH ; + ERR (GrB_Monoid_get_Scalar_ (GrB_PLUS_MONOID_INT32, s_fp64, + GxB_MONOID_IDENTITY)) ; + ERR (GrB_Monoid_get_Scalar_ (GrB_PLUS_MONOID_INT32, s_fp64, + GxB_MONOID_TERMINAL)) ; + ERR (GrB_Monoid_get_Scalar_ (GrB_MAX_MONOID_INT32, s_fp64, + GxB_MONOID_IDENTITY)) ; + ERR (GrB_Monoid_get_Scalar_ (GrB_MAX_MONOID_INT32, s_fp64, + GxB_MONOID_TERMINAL)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Monoid_get_Scalar_ (GrB_MAX_MONOID_INT32, s_fp64, + GrB_OUTP_FIELD)) ; + ERR (GrB_Monoid_set_String_(GrB_MAX_MONOID_INT32, "newname", GrB_NAME)) ; + + op = NULL ; + OK (GrB_Monoid_get_SIZE_ (monoid, &size, GxB_MONOID_OPERATOR)) ; + CHECK (size == sizeof (GrB_BinaryOp)) ; + OK (GrB_Monoid_get_VOID (monoid, (void *) (&op), GxB_MONOID_OPERATOR)) ; + CHECK (op == binop) ; + OK (GrB_Monoid_get_VOID_ (GrB_PLUS_MONOID_INT32, (void *) &op, + GxB_MONOID_OPERATOR)) ; + CHECK (op == GrB_PLUS_INT32) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GrB_free (&binop) ; + GrB_free (&monoid) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test31: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test32.c b/GraphBLAS/Test/GB_mex_test32.c new file mode 100644 index 0000000000..c35963840b --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test32.c @@ -0,0 +1,2271 @@ +//------------------------------------------------------------------------------ +// GB_mex_test32: test GrB_get and GrB_set (semirings) +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test32" + +#define FREE_ALL ; +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +#define GETOP(op,opname) \ +{ \ + size_t siz1, siz2, siz3 ; \ + OK (GrB_Semiring_get_String (op, name, GrB_NAME)) ; \ + CHECK (MATCH (name, opname)) ; \ + OK (GrB_Semiring_get_SIZE (op, &size, GrB_NAME)) ; \ + CHECK (size == strlen (name) + 1) ; \ + GrB_Info info2, info3 ; \ + info2 = GrB_Semiring_get_SIZE (op, &siz1, GrB_INP0_TYPE_STRING) ; \ + info3 = GrB_Semiring_get_String (op, name, GrB_INP0_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz1 == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (siz1 == 1) ; } \ + info2 = GrB_Semiring_get_SIZE (op, &siz2, GrB_INP1_TYPE_STRING) ; \ + info3 = GrB_Semiring_get_String (op, name, GrB_INP1_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz2 == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (siz1 == 1) ; } \ + info2 = GrB_Semiring_get_SIZE (op, &siz3, GrB_OUTP_TYPE_STRING) ; \ + info3 = GrB_Semiring_get_String (op, name, GrB_OUTP_TYPE_STRING) ; \ + CHECK (info2 == info3) ; \ + CHECK (siz3 == strlen (name) + 1) ; \ + if (info2 == GrB_NO_VALUE) { CHECK (siz1 == 1) ; } \ +} + +#define GETNAME(op) \ +{ \ + GETOP (op, #op) ; \ +/* OK (GxB_Semiring_fprint (sm, "semiring", 3, NULL)) ; */ \ +} + +#define GETNAM2(op,alias) \ +{ \ + GETOP (op,alias) ; \ +/* OK (GxB_Semiring_fprint (sm, "semiring", 3, NULL)) ; */ \ +} + +void mytimes (float *z, const float *x, const float *y) ; +void mytimes (float *z, const float *x, const float *y) { (*z) = (*x)*(*y) ; } +#define MYTIMES_DEFN \ +"void mytimes (float *z, const float *x, const float *y) { (*z) = (*x)*(*y) ; }" + +void myadd (float *z, const float *x, const float *y) ; +void myadd (float *z, const float *x, const float *y) { (*z) = (*x)+(*y) ; } +#define MYADD_DEFN \ +"void myadd (float *z, const float *x, const float *y) { (*z) = (*x)+(*y) ; }" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL ; + GrB_BinaryOp times = NULL, add = NULL, op = NULL ; + GrB_Monoid monoid = NULL, mon = NULL ; + GrB_Semiring semiring = NULL ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size ; + char name [1024] ; + char defn [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + GrB_Index nvals = 999 ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + + //-------------------------------------------------------------------------- + // GrB_Semiring get name + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // *_FIRST + //-------------------------------------------------------------------------- + + GETNAME (GrB_MIN_FIRST_SEMIRING_INT8) ; + GETNAME (GrB_MIN_FIRST_SEMIRING_INT16) ; + GETNAME (GrB_MIN_FIRST_SEMIRING_INT32) ; + GETNAME (GrB_MIN_FIRST_SEMIRING_INT64) ; + GETNAME (GrB_MIN_FIRST_SEMIRING_UINT8) ; + GETNAME (GrB_MIN_FIRST_SEMIRING_UINT16) ; + GETNAME (GrB_MIN_FIRST_SEMIRING_UINT32) ; + GETNAME (GrB_MIN_FIRST_SEMIRING_UINT64) ; + GETNAME (GrB_MIN_FIRST_SEMIRING_FP32) ; + GETNAME (GrB_MIN_FIRST_SEMIRING_FP64) ; + + GETNAM2 (GxB_MIN_FIRST_INT8, "GrB_MIN_FIRST_SEMIRING_INT8") ; + GETNAM2 (GxB_MIN_FIRST_INT16, "GrB_MIN_FIRST_SEMIRING_INT16") ; + GETNAM2 (GxB_MIN_FIRST_INT32, "GrB_MIN_FIRST_SEMIRING_INT32") ; + GETNAM2 (GxB_MIN_FIRST_INT64, "GrB_MIN_FIRST_SEMIRING_INT64") ; + GETNAM2 (GxB_MIN_FIRST_UINT8, "GrB_MIN_FIRST_SEMIRING_UINT8") ; + GETNAM2 (GxB_MIN_FIRST_UINT16, "GrB_MIN_FIRST_SEMIRING_UINT16") ; + GETNAM2 (GxB_MIN_FIRST_UINT32, "GrB_MIN_FIRST_SEMIRING_UINT32") ; + GETNAM2 (GxB_MIN_FIRST_UINT64, "GrB_MIN_FIRST_SEMIRING_UINT64") ; + GETNAM2 (GxB_MIN_FIRST_FP32, "GrB_MIN_FIRST_SEMIRING_FP32") ; + GETNAM2 (GxB_MIN_FIRST_FP64, "GrB_MIN_FIRST_SEMIRING_FP64") ; + + GETNAME (GrB_MAX_FIRST_SEMIRING_INT8) ; + GETNAME (GrB_MAX_FIRST_SEMIRING_INT16) ; + GETNAME (GrB_MAX_FIRST_SEMIRING_INT32) ; + GETNAME (GrB_MAX_FIRST_SEMIRING_INT64) ; + GETNAME (GrB_MAX_FIRST_SEMIRING_UINT8) ; + GETNAME (GrB_MAX_FIRST_SEMIRING_UINT16) ; + GETNAME (GrB_MAX_FIRST_SEMIRING_UINT32) ; + GETNAME (GrB_MAX_FIRST_SEMIRING_UINT64) ; + GETNAME (GrB_MAX_FIRST_SEMIRING_FP32) ; + GETNAME (GrB_MAX_FIRST_SEMIRING_FP64) ; + + GETNAM2 (GxB_MAX_FIRST_INT8, "GrB_MAX_FIRST_SEMIRING_INT8") ; + GETNAM2 (GxB_MAX_FIRST_INT16, "GrB_MAX_FIRST_SEMIRING_INT16") ; + GETNAM2 (GxB_MAX_FIRST_INT32, "GrB_MAX_FIRST_SEMIRING_INT32") ; + GETNAM2 (GxB_MAX_FIRST_INT64, "GrB_MAX_FIRST_SEMIRING_INT64") ; + GETNAM2 (GxB_MAX_FIRST_UINT8, "GrB_MAX_FIRST_SEMIRING_UINT8") ; + GETNAM2 (GxB_MAX_FIRST_UINT16, "GrB_MAX_FIRST_SEMIRING_UINT16") ; + GETNAM2 (GxB_MAX_FIRST_UINT32, "GrB_MAX_FIRST_SEMIRING_UINT32") ; + GETNAM2 (GxB_MAX_FIRST_UINT64, "GrB_MAX_FIRST_SEMIRING_UINT64") ; + GETNAM2 (GxB_MAX_FIRST_FP32, "GrB_MAX_FIRST_SEMIRING_FP32") ; + GETNAM2 (GxB_MAX_FIRST_FP64, "GrB_MAX_FIRST_SEMIRING_FP64") ; + + GETNAME (GxB_PLUS_FIRST_INT8) ; + GETNAME (GxB_PLUS_FIRST_INT16) ; + GETNAME (GxB_PLUS_FIRST_INT32) ; + GETNAME (GxB_PLUS_FIRST_INT64) ; + GETNAME (GxB_PLUS_FIRST_UINT8) ; + GETNAME (GxB_PLUS_FIRST_UINT16) ; + GETNAME (GxB_PLUS_FIRST_UINT32) ; + GETNAME (GxB_PLUS_FIRST_UINT64) ; + GETNAME (GxB_PLUS_FIRST_FP32) ; + GETNAME (GxB_PLUS_FIRST_FP64) ; + GETNAME (GxB_PLUS_FIRST_FC32) ; + GETNAME (GxB_PLUS_FIRST_FC64) ; + + GETNAME (GxB_TIMES_FIRST_INT8) ; + GETNAME (GxB_TIMES_FIRST_INT16) ; + GETNAME (GxB_TIMES_FIRST_INT32) ; + GETNAME (GxB_TIMES_FIRST_INT64) ; + GETNAME (GxB_TIMES_FIRST_UINT8) ; + GETNAME (GxB_TIMES_FIRST_UINT16) ; + GETNAME (GxB_TIMES_FIRST_UINT32) ; + GETNAME (GxB_TIMES_FIRST_UINT64) ; + GETNAME (GxB_TIMES_FIRST_FP32) ; + GETNAME (GxB_TIMES_FIRST_FP64) ; + GETNAME (GxB_TIMES_FIRST_FC32) ; + GETNAME (GxB_TIMES_FIRST_FC64) ; + + GETNAME (GxB_ANY_FIRST_INT8) ; + GETNAME (GxB_ANY_FIRST_INT16) ; + GETNAME (GxB_ANY_FIRST_INT32) ; + GETNAME (GxB_ANY_FIRST_INT64) ; + GETNAME (GxB_ANY_FIRST_UINT8) ; + GETNAME (GxB_ANY_FIRST_UINT16) ; + GETNAME (GxB_ANY_FIRST_UINT32) ; + GETNAME (GxB_ANY_FIRST_UINT64) ; + GETNAME (GxB_ANY_FIRST_FP32) ; + GETNAME (GxB_ANY_FIRST_FP64) ; + GETNAME (GxB_ANY_FIRST_FC32) ; + GETNAME (GxB_ANY_FIRST_FC64) ; + + GETNAME (GxB_LOR_FIRST_BOOL) ; + GETNAME (GxB_LAND_FIRST_BOOL) ; + GETNAME (GxB_LXOR_FIRST_BOOL) ; + GETNAME (GxB_EQ_FIRST_BOOL) ; + GETNAME (GxB_ANY_FIRST_BOOL) ; + + //-------------------------------------------------------------------------- + // *_SECOND + //-------------------------------------------------------------------------- + + GETNAME (GrB_MIN_SECOND_SEMIRING_INT8) ; + GETNAME (GrB_MIN_SECOND_SEMIRING_INT16) ; + GETNAME (GrB_MIN_SECOND_SEMIRING_INT32) ; + GETNAME (GrB_MIN_SECOND_SEMIRING_INT64) ; + GETNAME (GrB_MIN_SECOND_SEMIRING_UINT8) ; + GETNAME (GrB_MIN_SECOND_SEMIRING_UINT16) ; + GETNAME (GrB_MIN_SECOND_SEMIRING_UINT32) ; + GETNAME (GrB_MIN_SECOND_SEMIRING_UINT64) ; + GETNAME (GrB_MIN_SECOND_SEMIRING_FP32) ; + GETNAME (GrB_MIN_SECOND_SEMIRING_FP64) ; + + GETNAM2 (GxB_MIN_SECOND_INT8, "GrB_MIN_SECOND_SEMIRING_INT8") ; + GETNAM2 (GxB_MIN_SECOND_INT16, "GrB_MIN_SECOND_SEMIRING_INT16") ; + GETNAM2 (GxB_MIN_SECOND_INT32, "GrB_MIN_SECOND_SEMIRING_INT32") ; + GETNAM2 (GxB_MIN_SECOND_INT64, "GrB_MIN_SECOND_SEMIRING_INT64") ; + GETNAM2 (GxB_MIN_SECOND_UINT8, "GrB_MIN_SECOND_SEMIRING_UINT8") ; + GETNAM2 (GxB_MIN_SECOND_UINT16, "GrB_MIN_SECOND_SEMIRING_UINT16") ; + GETNAM2 (GxB_MIN_SECOND_UINT32, "GrB_MIN_SECOND_SEMIRING_UINT32") ; + GETNAM2 (GxB_MIN_SECOND_UINT64, "GrB_MIN_SECOND_SEMIRING_UINT64") ; + GETNAM2 (GxB_MIN_SECOND_FP32, "GrB_MIN_SECOND_SEMIRING_FP32") ; + GETNAM2 (GxB_MIN_SECOND_FP64, "GrB_MIN_SECOND_SEMIRING_FP64") ; + + GETNAME (GrB_MAX_SECOND_SEMIRING_INT8) ; + GETNAME (GrB_MAX_SECOND_SEMIRING_INT16) ; + GETNAME (GrB_MAX_SECOND_SEMIRING_INT32) ; + GETNAME (GrB_MAX_SECOND_SEMIRING_INT64) ; + GETNAME (GrB_MAX_SECOND_SEMIRING_UINT8) ; + GETNAME (GrB_MAX_SECOND_SEMIRING_UINT16) ; + GETNAME (GrB_MAX_SECOND_SEMIRING_UINT32) ; + GETNAME (GrB_MAX_SECOND_SEMIRING_UINT64) ; + GETNAME (GrB_MAX_SECOND_SEMIRING_FP32) ; + GETNAME (GrB_MAX_SECOND_SEMIRING_FP64) ; + + GETNAM2 (GxB_MAX_SECOND_INT8, "GrB_MAX_SECOND_SEMIRING_INT8") ; + GETNAM2 (GxB_MAX_SECOND_INT16, "GrB_MAX_SECOND_SEMIRING_INT16") ; + GETNAM2 (GxB_MAX_SECOND_INT32, "GrB_MAX_SECOND_SEMIRING_INT32") ; + GETNAM2 (GxB_MAX_SECOND_INT64, "GrB_MAX_SECOND_SEMIRING_INT64") ; + GETNAM2 (GxB_MAX_SECOND_UINT8, "GrB_MAX_SECOND_SEMIRING_UINT8") ; + GETNAM2 (GxB_MAX_SECOND_UINT16, "GrB_MAX_SECOND_SEMIRING_UINT16") ; + GETNAM2 (GxB_MAX_SECOND_UINT32, "GrB_MAX_SECOND_SEMIRING_UINT32") ; + GETNAM2 (GxB_MAX_SECOND_UINT64, "GrB_MAX_SECOND_SEMIRING_UINT64") ; + GETNAM2 (GxB_MAX_SECOND_FP32, "GrB_MAX_SECOND_SEMIRING_FP32") ; + GETNAM2 (GxB_MAX_SECOND_FP64, "GrB_MAX_SECOND_SEMIRING_FP64") ; + + GETNAME (GxB_PLUS_SECOND_INT8) ; + GETNAME (GxB_PLUS_SECOND_INT16) ; + GETNAME (GxB_PLUS_SECOND_INT32) ; + GETNAME (GxB_PLUS_SECOND_INT64) ; + GETNAME (GxB_PLUS_SECOND_UINT8) ; + GETNAME (GxB_PLUS_SECOND_UINT16) ; + GETNAME (GxB_PLUS_SECOND_UINT32) ; + GETNAME (GxB_PLUS_SECOND_UINT64) ; + GETNAME (GxB_PLUS_SECOND_FP32) ; + GETNAME (GxB_PLUS_SECOND_FP64) ; + GETNAME (GxB_PLUS_SECOND_FC32) ; + GETNAME (GxB_PLUS_SECOND_FC64) ; + + GETNAME (GxB_TIMES_SECOND_INT8) ; + GETNAME (GxB_TIMES_SECOND_INT16) ; + GETNAME (GxB_TIMES_SECOND_INT32) ; + GETNAME (GxB_TIMES_SECOND_INT64) ; + GETNAME (GxB_TIMES_SECOND_UINT8) ; + GETNAME (GxB_TIMES_SECOND_UINT16) ; + GETNAME (GxB_TIMES_SECOND_UINT32) ; + GETNAME (GxB_TIMES_SECOND_UINT64) ; + GETNAME (GxB_TIMES_SECOND_FP32) ; + GETNAME (GxB_TIMES_SECOND_FP64) ; + GETNAME (GxB_TIMES_SECOND_FC32) ; + GETNAME (GxB_TIMES_SECOND_FC64) ; + + GETNAME (GxB_ANY_SECOND_INT8) ; + GETNAME (GxB_ANY_SECOND_INT16) ; + GETNAME (GxB_ANY_SECOND_INT32) ; + GETNAME (GxB_ANY_SECOND_INT64) ; + GETNAME (GxB_ANY_SECOND_UINT8) ; + GETNAME (GxB_ANY_SECOND_UINT16) ; + GETNAME (GxB_ANY_SECOND_UINT32) ; + GETNAME (GxB_ANY_SECOND_UINT64) ; + GETNAME (GxB_ANY_SECOND_FP32) ; + GETNAME (GxB_ANY_SECOND_FP64) ; + GETNAME (GxB_ANY_SECOND_FC32) ; + GETNAME (GxB_ANY_SECOND_FC64) ; + + GETNAME (GxB_LOR_SECOND_BOOL) ; + GETNAME (GxB_LAND_SECOND_BOOL) ; + GETNAME (GxB_LXOR_SECOND_BOOL) ; + GETNAME (GxB_EQ_SECOND_BOOL) ; + GETNAME (GxB_ANY_SECOND_BOOL) ; + + //-------------------------------------------------------------------------- + // *_PAIR + //-------------------------------------------------------------------------- + + GETNAM2 (GxB_MIN_PAIR_INT8, "GxB_ANY_PAIR_INT8") ; + GETNAM2 (GxB_MIN_PAIR_INT16, "GxB_ANY_PAIR_INT16") ; + GETNAM2 (GxB_MIN_PAIR_INT32, "GxB_ANY_PAIR_INT32") ; + GETNAM2 (GxB_MIN_PAIR_INT64, "GxB_ANY_PAIR_INT64") ; + GETNAM2 (GxB_MIN_PAIR_UINT8, "GxB_ANY_PAIR_UINT8") ; + GETNAM2 (GxB_MIN_PAIR_UINT16, "GxB_ANY_PAIR_UINT16") ; + GETNAM2 (GxB_MIN_PAIR_UINT32, "GxB_ANY_PAIR_UINT32") ; + GETNAM2 (GxB_MIN_PAIR_UINT64, "GxB_ANY_PAIR_UINT64") ; + GETNAM2 (GxB_MIN_PAIR_FP32, "GxB_ANY_PAIR_FP32") ; + GETNAM2 (GxB_MIN_PAIR_FP64, "GxB_ANY_PAIR_FP64") ; + + GETNAM2 (GxB_MAX_PAIR_INT8, "GxB_ANY_PAIR_INT8") ; + GETNAM2 (GxB_MAX_PAIR_INT16, "GxB_ANY_PAIR_INT16") ; + GETNAM2 (GxB_MAX_PAIR_INT32, "GxB_ANY_PAIR_INT32") ; + GETNAM2 (GxB_MAX_PAIR_INT64, "GxB_ANY_PAIR_INT64") ; + GETNAM2 (GxB_MAX_PAIR_UINT8, "GxB_ANY_PAIR_UINT8") ; + GETNAM2 (GxB_MAX_PAIR_UINT16, "GxB_ANY_PAIR_UINT16") ; + GETNAM2 (GxB_MAX_PAIR_UINT32, "GxB_ANY_PAIR_UINT32") ; + GETNAM2 (GxB_MAX_PAIR_UINT64, "GxB_ANY_PAIR_UINT64") ; + GETNAM2 (GxB_MAX_PAIR_FP32, "GxB_ANY_PAIR_FP32") ; + GETNAM2 (GxB_MAX_PAIR_FP64, "GxB_ANY_PAIR_FP64") ; + + GETNAME (GxB_PLUS_PAIR_INT8) ; + GETNAME (GxB_PLUS_PAIR_INT16) ; + GETNAME (GxB_PLUS_PAIR_INT32) ; + GETNAME (GxB_PLUS_PAIR_INT64) ; + GETNAME (GxB_PLUS_PAIR_UINT8) ; + GETNAME (GxB_PLUS_PAIR_UINT16) ; + GETNAME (GxB_PLUS_PAIR_UINT32) ; + GETNAME (GxB_PLUS_PAIR_UINT64) ; + GETNAME (GxB_PLUS_PAIR_FP32) ; + GETNAME (GxB_PLUS_PAIR_FP64) ; + GETNAME (GxB_PLUS_PAIR_FC32) ; + GETNAME (GxB_PLUS_PAIR_FC64) ; + + GETNAM2 (GxB_TIMES_PAIR_INT8, "GxB_ANY_PAIR_INT8") ; + GETNAM2 (GxB_TIMES_PAIR_INT16, "GxB_ANY_PAIR_INT16") ; + GETNAM2 (GxB_TIMES_PAIR_INT32, "GxB_ANY_PAIR_INT32") ; + GETNAM2 (GxB_TIMES_PAIR_INT64, "GxB_ANY_PAIR_INT64") ; + GETNAM2 (GxB_TIMES_PAIR_UINT8, "GxB_ANY_PAIR_UINT8") ; + GETNAM2 (GxB_TIMES_PAIR_UINT16, "GxB_ANY_PAIR_UINT16") ; + GETNAM2 (GxB_TIMES_PAIR_UINT32, "GxB_ANY_PAIR_UINT32") ; + GETNAM2 (GxB_TIMES_PAIR_UINT64, "GxB_ANY_PAIR_UINT64") ; + GETNAM2 (GxB_TIMES_PAIR_FP32, "GxB_ANY_PAIR_FP32") ; + GETNAM2 (GxB_TIMES_PAIR_FP64, "GxB_ANY_PAIR_FP64") ; + GETNAM2 (GxB_TIMES_PAIR_FC32, "GxB_ANY_PAIR_FC32") ; + GETNAM2 (GxB_TIMES_PAIR_FC64, "GxB_ANY_PAIR_FC64") ; + + GETNAME (GxB_ANY_PAIR_INT8) ; + GETNAME (GxB_ANY_PAIR_INT16) ; + GETNAME (GxB_ANY_PAIR_INT32) ; + GETNAME (GxB_ANY_PAIR_INT64) ; + GETNAME (GxB_ANY_PAIR_UINT8) ; + GETNAME (GxB_ANY_PAIR_UINT16) ; + GETNAME (GxB_ANY_PAIR_UINT32) ; + GETNAME (GxB_ANY_PAIR_UINT64) ; + GETNAME (GxB_ANY_PAIR_FP32) ; + GETNAME (GxB_ANY_PAIR_FP64) ; + GETNAME (GxB_ANY_PAIR_FC32) ; + GETNAME (GxB_ANY_PAIR_FC64) ; + + GETNAM2 (GxB_LOR_PAIR_BOOL, "GxB_ANY_PAIR_BOOL") ; + GETNAM2 (GxB_LAND_PAIR_BOOL, "GxB_ANY_PAIR_BOOL") ; + GETNAME (GxB_LXOR_PAIR_BOOL) ; + GETNAM2 (GxB_EQ_PAIR_BOOL, "GxB_ANY_PAIR_BOOL") ; + GETNAME (GxB_ANY_PAIR_BOOL) ; + + //-------------------------------------------------------------------------- + // *_MIN + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_MIN_INT8) ; + GETNAME (GxB_MIN_MIN_INT16) ; + GETNAME (GxB_MIN_MIN_INT32) ; + GETNAME (GxB_MIN_MIN_INT64) ; + GETNAME (GxB_MIN_MIN_UINT8) ; + GETNAME (GxB_MIN_MIN_UINT16) ; + GETNAME (GxB_MIN_MIN_UINT32) ; + GETNAME (GxB_MIN_MIN_UINT64) ; + GETNAME (GxB_MIN_MIN_FP32) ; + GETNAME (GxB_MIN_MIN_FP64) ; + + GETNAME (GrB_MAX_MIN_SEMIRING_INT8) ; + GETNAME (GrB_MAX_MIN_SEMIRING_INT16) ; + GETNAME (GrB_MAX_MIN_SEMIRING_INT32) ; + GETNAME (GrB_MAX_MIN_SEMIRING_INT64) ; + GETNAME (GrB_MAX_MIN_SEMIRING_UINT8) ; + GETNAME (GrB_MAX_MIN_SEMIRING_UINT16) ; + GETNAME (GrB_MAX_MIN_SEMIRING_UINT32) ; + GETNAME (GrB_MAX_MIN_SEMIRING_UINT64) ; + GETNAME (GrB_MAX_MIN_SEMIRING_FP32) ; + GETNAME (GrB_MAX_MIN_SEMIRING_FP64) ; + + GETNAM2 (GxB_MAX_MIN_INT8, "GrB_MAX_MIN_SEMIRING_INT8") ; + GETNAM2 (GxB_MAX_MIN_INT16, "GrB_MAX_MIN_SEMIRING_INT16") ; + GETNAM2 (GxB_MAX_MIN_INT32, "GrB_MAX_MIN_SEMIRING_INT32") ; + GETNAM2 (GxB_MAX_MIN_INT64, "GrB_MAX_MIN_SEMIRING_INT64") ; + GETNAM2 (GxB_MAX_MIN_UINT8, "GrB_MAX_MIN_SEMIRING_UINT8") ; + GETNAM2 (GxB_MAX_MIN_UINT16, "GrB_MAX_MIN_SEMIRING_UINT16") ; + GETNAM2 (GxB_MAX_MIN_UINT32, "GrB_MAX_MIN_SEMIRING_UINT32") ; + GETNAM2 (GxB_MAX_MIN_UINT64, "GrB_MAX_MIN_SEMIRING_UINT64") ; + GETNAM2 (GxB_MAX_MIN_FP32, "GrB_MAX_MIN_SEMIRING_FP32") ; + GETNAM2 (GxB_MAX_MIN_FP64, "GrB_MAX_MIN_SEMIRING_FP64") ; + + GETNAME (GrB_PLUS_MIN_SEMIRING_INT8) ; + GETNAME (GrB_PLUS_MIN_SEMIRING_INT16) ; + GETNAME (GrB_PLUS_MIN_SEMIRING_INT32) ; + GETNAME (GrB_PLUS_MIN_SEMIRING_INT64) ; + GETNAME (GrB_PLUS_MIN_SEMIRING_UINT8) ; + GETNAME (GrB_PLUS_MIN_SEMIRING_UINT16) ; + GETNAME (GrB_PLUS_MIN_SEMIRING_UINT32) ; + GETNAME (GrB_PLUS_MIN_SEMIRING_UINT64) ; + GETNAME (GrB_PLUS_MIN_SEMIRING_FP32) ; + GETNAME (GrB_PLUS_MIN_SEMIRING_FP64) ; + + GETNAM2 (GxB_PLUS_MIN_INT8, "GrB_PLUS_MIN_SEMIRING_INT8") ; + GETNAM2 (GxB_PLUS_MIN_INT16, "GrB_PLUS_MIN_SEMIRING_INT16") ; + GETNAM2 (GxB_PLUS_MIN_INT32, "GrB_PLUS_MIN_SEMIRING_INT32") ; + GETNAM2 (GxB_PLUS_MIN_INT64, "GrB_PLUS_MIN_SEMIRING_INT64") ; + GETNAM2 (GxB_PLUS_MIN_UINT8, "GrB_PLUS_MIN_SEMIRING_UINT8") ; + GETNAM2 (GxB_PLUS_MIN_UINT16, "GrB_PLUS_MIN_SEMIRING_UINT16") ; + GETNAM2 (GxB_PLUS_MIN_UINT32, "GrB_PLUS_MIN_SEMIRING_UINT32") ; + GETNAM2 (GxB_PLUS_MIN_UINT64, "GrB_PLUS_MIN_SEMIRING_UINT64") ; + GETNAM2 (GxB_PLUS_MIN_FP32, "GrB_PLUS_MIN_SEMIRING_FP32") ; + GETNAM2 (GxB_PLUS_MIN_FP64, "GrB_PLUS_MIN_SEMIRING_FP64") ; + + GETNAME (GxB_TIMES_MIN_INT8) ; + GETNAME (GxB_TIMES_MIN_INT16) ; + GETNAME (GxB_TIMES_MIN_INT32) ; + GETNAME (GxB_TIMES_MIN_INT64) ; + GETNAME (GxB_TIMES_MIN_UINT8) ; + GETNAME (GxB_TIMES_MIN_UINT16) ; + GETNAME (GxB_TIMES_MIN_UINT32) ; + GETNAME (GxB_TIMES_MIN_UINT64) ; + GETNAME (GxB_TIMES_MIN_FP32) ; + GETNAME (GxB_TIMES_MIN_FP64) ; + + GETNAME (GxB_ANY_MIN_INT8) ; + GETNAME (GxB_ANY_MIN_INT16) ; + GETNAME (GxB_ANY_MIN_INT32) ; + GETNAME (GxB_ANY_MIN_INT64) ; + GETNAME (GxB_ANY_MIN_UINT8) ; + GETNAME (GxB_ANY_MIN_UINT16) ; + GETNAME (GxB_ANY_MIN_UINT32) ; + GETNAME (GxB_ANY_MIN_UINT64) ; + GETNAME (GxB_ANY_MIN_FP32) ; + GETNAME (GxB_ANY_MIN_FP64) ; + + //-------------------------------------------------------------------------- + // *_MAX + //-------------------------------------------------------------------------- + + GETNAME (GxB_MAX_MAX_INT8) ; + GETNAME (GxB_MAX_MAX_INT16) ; + GETNAME (GxB_MAX_MAX_INT32) ; + GETNAME (GxB_MAX_MAX_INT64) ; + GETNAME (GxB_MAX_MAX_UINT8) ; + GETNAME (GxB_MAX_MAX_UINT16) ; + GETNAME (GxB_MAX_MAX_UINT32) ; + GETNAME (GxB_MAX_MAX_UINT64) ; + GETNAME (GxB_MAX_MAX_FP32) ; + GETNAME (GxB_MAX_MAX_FP64) ; + + GETNAME (GrB_MIN_MAX_SEMIRING_INT8) ; + GETNAME (GrB_MIN_MAX_SEMIRING_INT16) ; + GETNAME (GrB_MIN_MAX_SEMIRING_INT32) ; + GETNAME (GrB_MIN_MAX_SEMIRING_INT64) ; + GETNAME (GrB_MIN_MAX_SEMIRING_UINT8) ; + GETNAME (GrB_MIN_MAX_SEMIRING_UINT16) ; + GETNAME (GrB_MIN_MAX_SEMIRING_UINT32) ; + GETNAME (GrB_MIN_MAX_SEMIRING_UINT64) ; + GETNAME (GrB_MIN_MAX_SEMIRING_FP32) ; + GETNAME (GrB_MIN_MAX_SEMIRING_FP64) ; + + GETNAM2 (GxB_MIN_MAX_INT8, "GrB_MIN_MAX_SEMIRING_INT8") ; + GETNAM2 (GxB_MIN_MAX_INT16, "GrB_MIN_MAX_SEMIRING_INT16") ; + GETNAM2 (GxB_MIN_MAX_INT32, "GrB_MIN_MAX_SEMIRING_INT32") ; + GETNAM2 (GxB_MIN_MAX_INT64, "GrB_MIN_MAX_SEMIRING_INT64") ; + GETNAM2 (GxB_MIN_MAX_UINT8, "GrB_MIN_MAX_SEMIRING_UINT8") ; + GETNAM2 (GxB_MIN_MAX_UINT16, "GrB_MIN_MAX_SEMIRING_UINT16") ; + GETNAM2 (GxB_MIN_MAX_UINT32, "GrB_MIN_MAX_SEMIRING_UINT32") ; + GETNAM2 (GxB_MIN_MAX_UINT64, "GrB_MIN_MAX_SEMIRING_UINT64") ; + GETNAM2 (GxB_MIN_MAX_FP32, "GrB_MIN_MAX_SEMIRING_FP32") ; + GETNAM2 (GxB_MIN_MAX_FP64, "GrB_MIN_MAX_SEMIRING_FP64") ; + + GETNAME (GxB_PLUS_MAX_INT8) ; + GETNAME (GxB_PLUS_MAX_INT16) ; + GETNAME (GxB_PLUS_MAX_INT32) ; + GETNAME (GxB_PLUS_MAX_INT64) ; + GETNAME (GxB_PLUS_MAX_UINT8) ; + GETNAME (GxB_PLUS_MAX_UINT16) ; + GETNAME (GxB_PLUS_MAX_UINT32) ; + GETNAME (GxB_PLUS_MAX_UINT64) ; + GETNAME (GxB_PLUS_MAX_FP32) ; + GETNAME (GxB_PLUS_MAX_FP64) ; + + GETNAME (GxB_TIMES_MAX_INT8) ; + GETNAME (GxB_TIMES_MAX_INT16) ; + GETNAME (GxB_TIMES_MAX_INT32) ; + GETNAME (GxB_TIMES_MAX_INT64) ; + GETNAME (GxB_TIMES_MAX_UINT8) ; + GETNAME (GxB_TIMES_MAX_UINT16) ; + GETNAME (GxB_TIMES_MAX_UINT32) ; + GETNAME (GxB_TIMES_MAX_UINT64) ; + GETNAME (GxB_TIMES_MAX_FP32) ; + GETNAME (GxB_TIMES_MAX_FP64) ; + + GETNAME (GxB_ANY_MAX_INT8) ; + GETNAME (GxB_ANY_MAX_INT16) ; + GETNAME (GxB_ANY_MAX_INT32) ; + GETNAME (GxB_ANY_MAX_INT64) ; + GETNAME (GxB_ANY_MAX_UINT8) ; + GETNAME (GxB_ANY_MAX_UINT16) ; + GETNAME (GxB_ANY_MAX_UINT32) ; + GETNAME (GxB_ANY_MAX_UINT64) ; + GETNAME (GxB_ANY_MAX_FP32) ; + GETNAME (GxB_ANY_MAX_FP64) ; + + //-------------------------------------------------------------------------- + // *_PLUS + //-------------------------------------------------------------------------- + + GETNAME (GrB_MIN_PLUS_SEMIRING_INT8) ; + GETNAME (GrB_MIN_PLUS_SEMIRING_INT16) ; + GETNAME (GrB_MIN_PLUS_SEMIRING_INT32) ; + GETNAME (GrB_MIN_PLUS_SEMIRING_INT64) ; + GETNAME (GrB_MIN_PLUS_SEMIRING_UINT8) ; + GETNAME (GrB_MIN_PLUS_SEMIRING_UINT16) ; + GETNAME (GrB_MIN_PLUS_SEMIRING_UINT32) ; + GETNAME (GrB_MIN_PLUS_SEMIRING_UINT64) ; + GETNAME (GrB_MIN_PLUS_SEMIRING_FP32) ; + GETNAME (GrB_MIN_PLUS_SEMIRING_FP64) ; + + GETNAM2 (GxB_MIN_PLUS_INT8, "GrB_MIN_PLUS_SEMIRING_INT8") ; + GETNAM2 (GxB_MIN_PLUS_INT16, "GrB_MIN_PLUS_SEMIRING_INT16") ; + GETNAM2 (GxB_MIN_PLUS_INT32, "GrB_MIN_PLUS_SEMIRING_INT32") ; + GETNAM2 (GxB_MIN_PLUS_INT64, "GrB_MIN_PLUS_SEMIRING_INT64") ; + GETNAM2 (GxB_MIN_PLUS_UINT8, "GrB_MIN_PLUS_SEMIRING_UINT8") ; + GETNAM2 (GxB_MIN_PLUS_UINT16, "GrB_MIN_PLUS_SEMIRING_UINT16") ; + GETNAM2 (GxB_MIN_PLUS_UINT32, "GrB_MIN_PLUS_SEMIRING_UINT32") ; + GETNAM2 (GxB_MIN_PLUS_UINT64, "GrB_MIN_PLUS_SEMIRING_UINT64") ; + GETNAM2 (GxB_MIN_PLUS_FP32, "GrB_MIN_PLUS_SEMIRING_FP32") ; + GETNAM2 (GxB_MIN_PLUS_FP64, "GrB_MIN_PLUS_SEMIRING_FP64") ; + + GETNAME (GrB_MAX_PLUS_SEMIRING_INT8) ; + GETNAME (GrB_MAX_PLUS_SEMIRING_INT16) ; + GETNAME (GrB_MAX_PLUS_SEMIRING_INT32) ; + GETNAME (GrB_MAX_PLUS_SEMIRING_INT64) ; + GETNAME (GrB_MAX_PLUS_SEMIRING_UINT8) ; + GETNAME (GrB_MAX_PLUS_SEMIRING_UINT16) ; + GETNAME (GrB_MAX_PLUS_SEMIRING_UINT32) ; + GETNAME (GrB_MAX_PLUS_SEMIRING_UINT64) ; + GETNAME (GrB_MAX_PLUS_SEMIRING_FP32) ; + GETNAME (GrB_MAX_PLUS_SEMIRING_FP64) ; + + GETNAM2 (GxB_MAX_PLUS_INT8, "GrB_MAX_PLUS_SEMIRING_INT8") ; + GETNAM2 (GxB_MAX_PLUS_INT16, "GrB_MAX_PLUS_SEMIRING_INT16") ; + GETNAM2 (GxB_MAX_PLUS_INT32, "GrB_MAX_PLUS_SEMIRING_INT32") ; + GETNAM2 (GxB_MAX_PLUS_INT64, "GrB_MAX_PLUS_SEMIRING_INT64") ; + GETNAM2 (GxB_MAX_PLUS_UINT8, "GrB_MAX_PLUS_SEMIRING_UINT8") ; + GETNAM2 (GxB_MAX_PLUS_UINT16, "GrB_MAX_PLUS_SEMIRING_UINT16") ; + GETNAM2 (GxB_MAX_PLUS_UINT32, "GrB_MAX_PLUS_SEMIRING_UINT32") ; + GETNAM2 (GxB_MAX_PLUS_UINT64, "GrB_MAX_PLUS_SEMIRING_UINT64") ; + GETNAM2 (GxB_MAX_PLUS_FP32, "GrB_MAX_PLUS_SEMIRING_FP32") ; + GETNAM2 (GxB_MAX_PLUS_FP64, "GrB_MAX_PLUS_SEMIRING_FP64") ; + + GETNAME (GxB_PLUS_PLUS_INT8) ; + GETNAME (GxB_PLUS_PLUS_INT16) ; + GETNAME (GxB_PLUS_PLUS_INT32) ; + GETNAME (GxB_PLUS_PLUS_INT64) ; + GETNAME (GxB_PLUS_PLUS_UINT8) ; + GETNAME (GxB_PLUS_PLUS_UINT16) ; + GETNAME (GxB_PLUS_PLUS_UINT32) ; + GETNAME (GxB_PLUS_PLUS_UINT64) ; + GETNAME (GxB_PLUS_PLUS_FP32) ; + GETNAME (GxB_PLUS_PLUS_FP64) ; + GETNAME (GxB_PLUS_PLUS_FC32) ; + GETNAME (GxB_PLUS_PLUS_FC64) ; + + GETNAME (GxB_TIMES_PLUS_INT8) ; + GETNAME (GxB_TIMES_PLUS_INT16) ; + GETNAME (GxB_TIMES_PLUS_INT32) ; + GETNAME (GxB_TIMES_PLUS_INT64) ; + GETNAME (GxB_TIMES_PLUS_UINT8) ; + GETNAME (GxB_TIMES_PLUS_UINT16) ; + GETNAME (GxB_TIMES_PLUS_UINT32) ; + GETNAME (GxB_TIMES_PLUS_UINT64) ; + GETNAME (GxB_TIMES_PLUS_FP32) ; + GETNAME (GxB_TIMES_PLUS_FP64) ; + GETNAME (GxB_TIMES_PLUS_FC32) ; + GETNAME (GxB_TIMES_PLUS_FC64) ; + + GETNAME (GxB_ANY_PLUS_INT8) ; + GETNAME (GxB_ANY_PLUS_INT16) ; + GETNAME (GxB_ANY_PLUS_INT32) ; + GETNAME (GxB_ANY_PLUS_INT64) ; + GETNAME (GxB_ANY_PLUS_UINT8) ; + GETNAME (GxB_ANY_PLUS_UINT16) ; + GETNAME (GxB_ANY_PLUS_UINT32) ; + GETNAME (GxB_ANY_PLUS_UINT64) ; + GETNAME (GxB_ANY_PLUS_FP32) ; + GETNAME (GxB_ANY_PLUS_FP64) ; + GETNAME (GxB_ANY_PLUS_FC32) ; + GETNAME (GxB_ANY_PLUS_FC64) ; + + //-------------------------------------------------------------------------- + // *_MINUS + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_MINUS_INT8) ; + GETNAME (GxB_MIN_MINUS_INT16) ; + GETNAME (GxB_MIN_MINUS_INT32) ; + GETNAME (GxB_MIN_MINUS_INT64) ; + GETNAME (GxB_MIN_MINUS_UINT8) ; + GETNAME (GxB_MIN_MINUS_UINT16) ; + GETNAME (GxB_MIN_MINUS_UINT32) ; + GETNAME (GxB_MIN_MINUS_UINT64) ; + GETNAME (GxB_MIN_MINUS_FP32) ; + GETNAME (GxB_MIN_MINUS_FP64) ; + + GETNAME (GxB_MAX_MINUS_INT8) ; + GETNAME (GxB_MAX_MINUS_INT16) ; + GETNAME (GxB_MAX_MINUS_INT32) ; + GETNAME (GxB_MAX_MINUS_INT64) ; + GETNAME (GxB_MAX_MINUS_UINT8) ; + GETNAME (GxB_MAX_MINUS_UINT16) ; + GETNAME (GxB_MAX_MINUS_UINT32) ; + GETNAME (GxB_MAX_MINUS_UINT64) ; + GETNAME (GxB_MAX_MINUS_FP32) ; + GETNAME (GxB_MAX_MINUS_FP64) ; + + GETNAME (GxB_PLUS_MINUS_INT8) ; + GETNAME (GxB_PLUS_MINUS_INT16) ; + GETNAME (GxB_PLUS_MINUS_INT32) ; + GETNAME (GxB_PLUS_MINUS_INT64) ; + GETNAME (GxB_PLUS_MINUS_UINT8) ; + GETNAME (GxB_PLUS_MINUS_UINT16) ; + GETNAME (GxB_PLUS_MINUS_UINT32) ; + GETNAME (GxB_PLUS_MINUS_UINT64) ; + GETNAME (GxB_PLUS_MINUS_FP32) ; + GETNAME (GxB_PLUS_MINUS_FP64) ; + GETNAME (GxB_PLUS_MINUS_FC32) ; + GETNAME (GxB_PLUS_MINUS_FC64) ; + + GETNAME (GxB_TIMES_MINUS_INT8) ; + GETNAME (GxB_TIMES_MINUS_INT16) ; + GETNAME (GxB_TIMES_MINUS_INT32) ; + GETNAME (GxB_TIMES_MINUS_INT64) ; + GETNAME (GxB_TIMES_MINUS_UINT8) ; + GETNAME (GxB_TIMES_MINUS_UINT16) ; + GETNAME (GxB_TIMES_MINUS_UINT32) ; + GETNAME (GxB_TIMES_MINUS_UINT64) ; + GETNAME (GxB_TIMES_MINUS_FP32) ; + GETNAME (GxB_TIMES_MINUS_FP64) ; + GETNAME (GxB_TIMES_MINUS_FC32) ; + GETNAME (GxB_TIMES_MINUS_FC64) ; + + GETNAME (GxB_ANY_MINUS_INT8) ; + GETNAME (GxB_ANY_MINUS_INT16) ; + GETNAME (GxB_ANY_MINUS_INT32) ; + GETNAME (GxB_ANY_MINUS_INT64) ; + GETNAME (GxB_ANY_MINUS_UINT8) ; + GETNAME (GxB_ANY_MINUS_UINT16) ; + GETNAME (GxB_ANY_MINUS_UINT32) ; + GETNAME (GxB_ANY_MINUS_UINT64) ; + GETNAME (GxB_ANY_MINUS_FP32) ; + GETNAME (GxB_ANY_MINUS_FP64) ; + GETNAME (GxB_ANY_MINUS_FC32) ; + GETNAME (GxB_ANY_MINUS_FC64) ; + + //-------------------------------------------------------------------------- + // *_TIMES + //-------------------------------------------------------------------------- + + GETNAME (GrB_MIN_TIMES_SEMIRING_INT8) ; + GETNAME (GrB_MIN_TIMES_SEMIRING_INT16) ; + GETNAME (GrB_MIN_TIMES_SEMIRING_INT32) ; + GETNAME (GrB_MIN_TIMES_SEMIRING_INT64) ; + GETNAME (GrB_MIN_TIMES_SEMIRING_UINT8) ; + GETNAME (GrB_MIN_TIMES_SEMIRING_UINT16) ; + GETNAME (GrB_MIN_TIMES_SEMIRING_UINT32) ; + GETNAME (GrB_MIN_TIMES_SEMIRING_UINT64) ; + GETNAME (GrB_MIN_TIMES_SEMIRING_FP32) ; + GETNAME (GrB_MIN_TIMES_SEMIRING_FP64) ; + + GETNAM2 (GxB_MIN_TIMES_INT8, "GrB_MIN_TIMES_SEMIRING_INT8") ; + GETNAM2 (GxB_MIN_TIMES_INT16, "GrB_MIN_TIMES_SEMIRING_INT16") ; + GETNAM2 (GxB_MIN_TIMES_INT32, "GrB_MIN_TIMES_SEMIRING_INT32") ; + GETNAM2 (GxB_MIN_TIMES_INT64, "GrB_MIN_TIMES_SEMIRING_INT64") ; + GETNAM2 (GxB_MIN_TIMES_UINT8, "GrB_MIN_TIMES_SEMIRING_UINT8") ; + GETNAM2 (GxB_MIN_TIMES_UINT16, "GrB_MIN_TIMES_SEMIRING_UINT16") ; + GETNAM2 (GxB_MIN_TIMES_UINT32, "GrB_MIN_TIMES_SEMIRING_UINT32") ; + GETNAM2 (GxB_MIN_TIMES_UINT64, "GrB_MIN_TIMES_SEMIRING_UINT64") ; + GETNAM2 (GxB_MIN_TIMES_FP32, "GrB_MIN_TIMES_SEMIRING_FP32") ; + GETNAM2 (GxB_MIN_TIMES_FP64, "GrB_MIN_TIMES_SEMIRING_FP64") ; + + GETNAME (GrB_MAX_TIMES_SEMIRING_INT8) ; + GETNAME (GrB_MAX_TIMES_SEMIRING_INT16) ; + GETNAME (GrB_MAX_TIMES_SEMIRING_INT32) ; + GETNAME (GrB_MAX_TIMES_SEMIRING_INT64) ; + GETNAME (GrB_MAX_TIMES_SEMIRING_UINT8) ; + GETNAME (GrB_MAX_TIMES_SEMIRING_UINT16) ; + GETNAME (GrB_MAX_TIMES_SEMIRING_UINT32) ; + GETNAME (GrB_MAX_TIMES_SEMIRING_UINT64) ; + GETNAME (GrB_MAX_TIMES_SEMIRING_FP32) ; + GETNAME (GrB_MAX_TIMES_SEMIRING_FP64) ; + + GETNAM2 (GxB_MAX_TIMES_INT8, "GrB_MAX_TIMES_SEMIRING_INT8") ; + GETNAM2 (GxB_MAX_TIMES_INT16, "GrB_MAX_TIMES_SEMIRING_INT16") ; + GETNAM2 (GxB_MAX_TIMES_INT32, "GrB_MAX_TIMES_SEMIRING_INT32") ; + GETNAM2 (GxB_MAX_TIMES_INT64, "GrB_MAX_TIMES_SEMIRING_INT64") ; + GETNAM2 (GxB_MAX_TIMES_UINT8, "GrB_MAX_TIMES_SEMIRING_UINT8") ; + GETNAM2 (GxB_MAX_TIMES_UINT16, "GrB_MAX_TIMES_SEMIRING_UINT16") ; + GETNAM2 (GxB_MAX_TIMES_UINT32, "GrB_MAX_TIMES_SEMIRING_UINT32") ; + GETNAM2 (GxB_MAX_TIMES_UINT64, "GrB_MAX_TIMES_SEMIRING_UINT64") ; + GETNAM2 (GxB_MAX_TIMES_FP32, "GrB_MAX_TIMES_SEMIRING_FP32") ; + GETNAM2 (GxB_MAX_TIMES_FP64, "GrB_MAX_TIMES_SEMIRING_FP64") ; + + GETNAME (GrB_PLUS_TIMES_SEMIRING_INT8) ; + GETNAME (GrB_PLUS_TIMES_SEMIRING_INT16) ; + GETNAME (GrB_PLUS_TIMES_SEMIRING_INT32) ; + GETNAME (GrB_PLUS_TIMES_SEMIRING_INT64) ; + GETNAME (GrB_PLUS_TIMES_SEMIRING_UINT8) ; + GETNAME (GrB_PLUS_TIMES_SEMIRING_UINT16) ; + GETNAME (GrB_PLUS_TIMES_SEMIRING_UINT32) ; + GETNAME (GrB_PLUS_TIMES_SEMIRING_UINT64) ; + GETNAME (GrB_PLUS_TIMES_SEMIRING_FP32) ; + GETNAME (GrB_PLUS_TIMES_SEMIRING_FP64) ; + + GETNAM2 (GxB_PLUS_TIMES_INT8, "GrB_PLUS_TIMES_SEMIRING_INT8") ; + GETNAM2 (GxB_PLUS_TIMES_INT16, "GrB_PLUS_TIMES_SEMIRING_INT16") ; + GETNAM2 (GxB_PLUS_TIMES_INT32, "GrB_PLUS_TIMES_SEMIRING_INT32") ; + GETNAM2 (GxB_PLUS_TIMES_INT64, "GrB_PLUS_TIMES_SEMIRING_INT64") ; + GETNAM2 (GxB_PLUS_TIMES_UINT8, "GrB_PLUS_TIMES_SEMIRING_UINT8") ; + GETNAM2 (GxB_PLUS_TIMES_UINT16, "GrB_PLUS_TIMES_SEMIRING_UINT16") ; + GETNAM2 (GxB_PLUS_TIMES_UINT32, "GrB_PLUS_TIMES_SEMIRING_UINT32") ; + GETNAM2 (GxB_PLUS_TIMES_UINT64, "GrB_PLUS_TIMES_SEMIRING_UINT64") ; + GETNAM2 (GxB_PLUS_TIMES_FP32, "GrB_PLUS_TIMES_SEMIRING_FP32") ; + GETNAM2 (GxB_PLUS_TIMES_FP64, "GrB_PLUS_TIMES_SEMIRING_FP64") ; + GETNAME (GxB_PLUS_TIMES_FC32) ; + GETNAME (GxB_PLUS_TIMES_FC64) ; + + GETNAME (GxB_TIMES_TIMES_INT8) ; + GETNAME (GxB_TIMES_TIMES_INT16) ; + GETNAME (GxB_TIMES_TIMES_INT32) ; + GETNAME (GxB_TIMES_TIMES_INT64) ; + GETNAME (GxB_TIMES_TIMES_UINT8) ; + GETNAME (GxB_TIMES_TIMES_UINT16) ; + GETNAME (GxB_TIMES_TIMES_UINT32) ; + GETNAME (GxB_TIMES_TIMES_UINT64) ; + GETNAME (GxB_TIMES_TIMES_FP32) ; + GETNAME (GxB_TIMES_TIMES_FP64) ; + GETNAME (GxB_TIMES_TIMES_FC32) ; + GETNAME (GxB_TIMES_TIMES_FC64) ; + + GETNAME (GxB_ANY_TIMES_INT8) ; + GETNAME (GxB_ANY_TIMES_INT16) ; + GETNAME (GxB_ANY_TIMES_INT32) ; + GETNAME (GxB_ANY_TIMES_INT64) ; + GETNAME (GxB_ANY_TIMES_UINT8) ; + GETNAME (GxB_ANY_TIMES_UINT16) ; + GETNAME (GxB_ANY_TIMES_UINT32) ; + GETNAME (GxB_ANY_TIMES_UINT64) ; + GETNAME (GxB_ANY_TIMES_FP32) ; + GETNAME (GxB_ANY_TIMES_FP64) ; + GETNAME (GxB_ANY_TIMES_FC32) ; + GETNAME (GxB_ANY_TIMES_FC64) ; + + //-------------------------------------------------------------------------- + // *_DIV + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_DIV_INT8) ; + GETNAME (GxB_MIN_DIV_INT16) ; + GETNAME (GxB_MIN_DIV_INT32) ; + GETNAME (GxB_MIN_DIV_INT64) ; + GETNAME (GxB_MIN_DIV_UINT8) ; + GETNAME (GxB_MIN_DIV_UINT16) ; + GETNAME (GxB_MIN_DIV_UINT32) ; + GETNAME (GxB_MIN_DIV_UINT64) ; + GETNAME (GxB_MIN_DIV_FP32) ; + GETNAME (GxB_MIN_DIV_FP64) ; + + GETNAME (GxB_MAX_DIV_INT8) ; + GETNAME (GxB_MAX_DIV_INT16) ; + GETNAME (GxB_MAX_DIV_INT32) ; + GETNAME (GxB_MAX_DIV_INT64) ; + GETNAME (GxB_MAX_DIV_UINT8) ; + GETNAME (GxB_MAX_DIV_UINT16) ; + GETNAME (GxB_MAX_DIV_UINT32) ; + GETNAME (GxB_MAX_DIV_UINT64) ; + GETNAME (GxB_MAX_DIV_FP32) ; + GETNAME (GxB_MAX_DIV_FP64) ; + + GETNAME (GxB_PLUS_DIV_INT8) ; + GETNAME (GxB_PLUS_DIV_INT16) ; + GETNAME (GxB_PLUS_DIV_INT32) ; + GETNAME (GxB_PLUS_DIV_INT64) ; + GETNAME (GxB_PLUS_DIV_UINT8) ; + GETNAME (GxB_PLUS_DIV_UINT16) ; + GETNAME (GxB_PLUS_DIV_UINT32) ; + GETNAME (GxB_PLUS_DIV_UINT64) ; + GETNAME (GxB_PLUS_DIV_FP32) ; + GETNAME (GxB_PLUS_DIV_FP64) ; + GETNAME (GxB_PLUS_DIV_FC32) ; + GETNAME (GxB_PLUS_DIV_FC64) ; + + GETNAME (GxB_TIMES_DIV_INT8) ; + GETNAME (GxB_TIMES_DIV_INT16) ; + GETNAME (GxB_TIMES_DIV_INT32) ; + GETNAME (GxB_TIMES_DIV_INT64) ; + GETNAME (GxB_TIMES_DIV_UINT8) ; + GETNAME (GxB_TIMES_DIV_UINT16) ; + GETNAME (GxB_TIMES_DIV_UINT32) ; + GETNAME (GxB_TIMES_DIV_UINT64) ; + GETNAME (GxB_TIMES_DIV_FP32) ; + GETNAME (GxB_TIMES_DIV_FP64) ; + GETNAME (GxB_TIMES_DIV_FC32) ; + GETNAME (GxB_TIMES_DIV_FC64) ; + + GETNAME (GxB_ANY_DIV_INT8) ; + GETNAME (GxB_ANY_DIV_INT16) ; + GETNAME (GxB_ANY_DIV_INT32) ; + GETNAME (GxB_ANY_DIV_INT64) ; + GETNAME (GxB_ANY_DIV_UINT8) ; + GETNAME (GxB_ANY_DIV_UINT16) ; + GETNAME (GxB_ANY_DIV_UINT32) ; + GETNAME (GxB_ANY_DIV_UINT64) ; + GETNAME (GxB_ANY_DIV_FP32) ; + GETNAME (GxB_ANY_DIV_FP64) ; + GETNAME (GxB_ANY_DIV_FC32) ; + GETNAME (GxB_ANY_DIV_FC64) ; + + //-------------------------------------------------------------------------- + // *_RDIV + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_RDIV_INT8) ; + GETNAME (GxB_MIN_RDIV_INT16) ; + GETNAME (GxB_MIN_RDIV_INT32) ; + GETNAME (GxB_MIN_RDIV_INT64) ; + GETNAME (GxB_MIN_RDIV_UINT8) ; + GETNAME (GxB_MIN_RDIV_UINT16) ; + GETNAME (GxB_MIN_RDIV_UINT32) ; + GETNAME (GxB_MIN_RDIV_UINT64) ; + GETNAME (GxB_MIN_RDIV_FP32) ; + GETNAME (GxB_MIN_RDIV_FP64) ; + + GETNAME (GxB_MAX_RDIV_INT8) ; + GETNAME (GxB_MAX_RDIV_INT16) ; + GETNAME (GxB_MAX_RDIV_INT32) ; + GETNAME (GxB_MAX_RDIV_INT64) ; + GETNAME (GxB_MAX_RDIV_UINT8) ; + GETNAME (GxB_MAX_RDIV_UINT16) ; + GETNAME (GxB_MAX_RDIV_UINT32) ; + GETNAME (GxB_MAX_RDIV_UINT64) ; + GETNAME (GxB_MAX_RDIV_FP32) ; + GETNAME (GxB_MAX_RDIV_FP64) ; + + GETNAME (GxB_PLUS_RDIV_INT8) ; + GETNAME (GxB_PLUS_RDIV_INT16) ; + GETNAME (GxB_PLUS_RDIV_INT32) ; + GETNAME (GxB_PLUS_RDIV_INT64) ; + GETNAME (GxB_PLUS_RDIV_UINT8) ; + GETNAME (GxB_PLUS_RDIV_UINT16) ; + GETNAME (GxB_PLUS_RDIV_UINT32) ; + GETNAME (GxB_PLUS_RDIV_UINT64) ; + GETNAME (GxB_PLUS_RDIV_FP32) ; + GETNAME (GxB_PLUS_RDIV_FP64) ; + GETNAME (GxB_PLUS_RDIV_FC32) ; + GETNAME (GxB_PLUS_RDIV_FC64) ; + + GETNAME (GxB_TIMES_RDIV_INT8) ; + GETNAME (GxB_TIMES_RDIV_INT16) ; + GETNAME (GxB_TIMES_RDIV_INT32) ; + GETNAME (GxB_TIMES_RDIV_INT64) ; + GETNAME (GxB_TIMES_RDIV_UINT8) ; + GETNAME (GxB_TIMES_RDIV_UINT16) ; + GETNAME (GxB_TIMES_RDIV_UINT32) ; + GETNAME (GxB_TIMES_RDIV_UINT64) ; + GETNAME (GxB_TIMES_RDIV_FP32) ; + GETNAME (GxB_TIMES_RDIV_FP64) ; + GETNAME (GxB_TIMES_RDIV_FC32) ; + GETNAME (GxB_TIMES_RDIV_FC64) ; + + GETNAME (GxB_ANY_RDIV_INT8) ; + GETNAME (GxB_ANY_RDIV_INT16) ; + GETNAME (GxB_ANY_RDIV_INT32) ; + GETNAME (GxB_ANY_RDIV_INT64) ; + GETNAME (GxB_ANY_RDIV_UINT8) ; + GETNAME (GxB_ANY_RDIV_UINT16) ; + GETNAME (GxB_ANY_RDIV_UINT32) ; + GETNAME (GxB_ANY_RDIV_UINT64) ; + GETNAME (GxB_ANY_RDIV_FP32) ; + GETNAME (GxB_ANY_RDIV_FP64) ; + GETNAME (GxB_ANY_RDIV_FC32) ; + GETNAME (GxB_ANY_RDIV_FC64) ; + + //-------------------------------------------------------------------------- + // *_RMINUS + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_RMINUS_INT8) ; + GETNAME (GxB_MIN_RMINUS_INT16) ; + GETNAME (GxB_MIN_RMINUS_INT32) ; + GETNAME (GxB_MIN_RMINUS_INT64) ; + GETNAME (GxB_MIN_RMINUS_UINT8) ; + GETNAME (GxB_MIN_RMINUS_UINT16) ; + GETNAME (GxB_MIN_RMINUS_UINT32) ; + GETNAME (GxB_MIN_RMINUS_UINT64) ; + GETNAME (GxB_MIN_RMINUS_FP32) ; + GETNAME (GxB_MIN_RMINUS_FP64) ; + + GETNAME (GxB_MAX_RMINUS_INT8) ; + GETNAME (GxB_MAX_RMINUS_INT16) ; + GETNAME (GxB_MAX_RMINUS_INT32) ; + GETNAME (GxB_MAX_RMINUS_INT64) ; + GETNAME (GxB_MAX_RMINUS_UINT8) ; + GETNAME (GxB_MAX_RMINUS_UINT16) ; + GETNAME (GxB_MAX_RMINUS_UINT32) ; + GETNAME (GxB_MAX_RMINUS_UINT64) ; + GETNAME (GxB_MAX_RMINUS_FP32) ; + GETNAME (GxB_MAX_RMINUS_FP64) ; + + GETNAME (GxB_PLUS_RMINUS_INT8) ; + GETNAME (GxB_PLUS_RMINUS_INT16) ; + GETNAME (GxB_PLUS_RMINUS_INT32) ; + GETNAME (GxB_PLUS_RMINUS_INT64) ; + GETNAME (GxB_PLUS_RMINUS_UINT8) ; + GETNAME (GxB_PLUS_RMINUS_UINT16) ; + GETNAME (GxB_PLUS_RMINUS_UINT32) ; + GETNAME (GxB_PLUS_RMINUS_UINT64) ; + GETNAME (GxB_PLUS_RMINUS_FP32) ; + GETNAME (GxB_PLUS_RMINUS_FP64) ; + GETNAME (GxB_PLUS_RMINUS_FC32) ; + GETNAME (GxB_PLUS_RMINUS_FC64) ; + + GETNAME (GxB_TIMES_RMINUS_INT8) ; + GETNAME (GxB_TIMES_RMINUS_INT16) ; + GETNAME (GxB_TIMES_RMINUS_INT32) ; + GETNAME (GxB_TIMES_RMINUS_INT64) ; + GETNAME (GxB_TIMES_RMINUS_UINT8) ; + GETNAME (GxB_TIMES_RMINUS_UINT16) ; + GETNAME (GxB_TIMES_RMINUS_UINT32) ; + GETNAME (GxB_TIMES_RMINUS_UINT64) ; + GETNAME (GxB_TIMES_RMINUS_FP32) ; + GETNAME (GxB_TIMES_RMINUS_FP64) ; + GETNAME (GxB_TIMES_RMINUS_FC32) ; + GETNAME (GxB_TIMES_RMINUS_FC64) ; + + GETNAME (GxB_ANY_RMINUS_INT8) ; + GETNAME (GxB_ANY_RMINUS_INT16) ; + GETNAME (GxB_ANY_RMINUS_INT32) ; + GETNAME (GxB_ANY_RMINUS_INT64) ; + GETNAME (GxB_ANY_RMINUS_UINT8) ; + GETNAME (GxB_ANY_RMINUS_UINT16) ; + GETNAME (GxB_ANY_RMINUS_UINT32) ; + GETNAME (GxB_ANY_RMINUS_UINT64) ; + GETNAME (GxB_ANY_RMINUS_FP32) ; + GETNAME (GxB_ANY_RMINUS_FP64) ; + GETNAME (GxB_ANY_RMINUS_FC32) ; + GETNAME (GxB_ANY_RMINUS_FC64) ; + + //-------------------------------------------------------------------------- + // *_ISEQ + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_ISEQ_INT8) ; + GETNAME (GxB_MIN_ISEQ_INT16) ; + GETNAME (GxB_MIN_ISEQ_INT32) ; + GETNAME (GxB_MIN_ISEQ_INT64) ; + GETNAME (GxB_MIN_ISEQ_UINT8) ; + GETNAME (GxB_MIN_ISEQ_UINT16) ; + GETNAME (GxB_MIN_ISEQ_UINT32) ; + GETNAME (GxB_MIN_ISEQ_UINT64) ; + GETNAME (GxB_MIN_ISEQ_FP32) ; + GETNAME (GxB_MIN_ISEQ_FP64) ; + + GETNAME (GxB_MAX_ISEQ_INT8) ; + GETNAME (GxB_MAX_ISEQ_INT16) ; + GETNAME (GxB_MAX_ISEQ_INT32) ; + GETNAME (GxB_MAX_ISEQ_INT64) ; + GETNAME (GxB_MAX_ISEQ_UINT8) ; + GETNAME (GxB_MAX_ISEQ_UINT16) ; + GETNAME (GxB_MAX_ISEQ_UINT32) ; + GETNAME (GxB_MAX_ISEQ_UINT64) ; + GETNAME (GxB_MAX_ISEQ_FP32) ; + GETNAME (GxB_MAX_ISEQ_FP64) ; + + GETNAME (GxB_PLUS_ISEQ_INT8) ; + GETNAME (GxB_PLUS_ISEQ_INT16) ; + GETNAME (GxB_PLUS_ISEQ_INT32) ; + GETNAME (GxB_PLUS_ISEQ_INT64) ; + GETNAME (GxB_PLUS_ISEQ_UINT8) ; + GETNAME (GxB_PLUS_ISEQ_UINT16) ; + GETNAME (GxB_PLUS_ISEQ_UINT32) ; + GETNAME (GxB_PLUS_ISEQ_UINT64) ; + GETNAME (GxB_PLUS_ISEQ_FP32) ; + GETNAME (GxB_PLUS_ISEQ_FP64) ; + + GETNAME (GxB_TIMES_ISEQ_INT8) ; + GETNAME (GxB_TIMES_ISEQ_INT16) ; + GETNAME (GxB_TIMES_ISEQ_INT32) ; + GETNAME (GxB_TIMES_ISEQ_INT64) ; + GETNAME (GxB_TIMES_ISEQ_UINT8) ; + GETNAME (GxB_TIMES_ISEQ_UINT16) ; + GETNAME (GxB_TIMES_ISEQ_UINT32) ; + GETNAME (GxB_TIMES_ISEQ_UINT64) ; + GETNAME (GxB_TIMES_ISEQ_FP32) ; + GETNAME (GxB_TIMES_ISEQ_FP64) ; + + GETNAME (GxB_ANY_ISEQ_INT8) ; + GETNAME (GxB_ANY_ISEQ_INT16) ; + GETNAME (GxB_ANY_ISEQ_INT32) ; + GETNAME (GxB_ANY_ISEQ_INT64) ; + GETNAME (GxB_ANY_ISEQ_UINT8) ; + GETNAME (GxB_ANY_ISEQ_UINT16) ; + GETNAME (GxB_ANY_ISEQ_UINT32) ; + GETNAME (GxB_ANY_ISEQ_UINT64) ; + GETNAME (GxB_ANY_ISEQ_FP32) ; + GETNAME (GxB_ANY_ISEQ_FP64) ; + + //-------------------------------------------------------------------------- + // *_ISNE + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_ISNE_INT8) ; + GETNAME (GxB_MIN_ISNE_INT16) ; + GETNAME (GxB_MIN_ISNE_INT32) ; + GETNAME (GxB_MIN_ISNE_INT64) ; + GETNAME (GxB_MIN_ISNE_UINT8) ; + GETNAME (GxB_MIN_ISNE_UINT16) ; + GETNAME (GxB_MIN_ISNE_UINT32) ; + GETNAME (GxB_MIN_ISNE_UINT64) ; + GETNAME (GxB_MIN_ISNE_FP32) ; + GETNAME (GxB_MIN_ISNE_FP64) ; + + GETNAME (GxB_MAX_ISNE_INT8) ; + GETNAME (GxB_MAX_ISNE_INT16) ; + GETNAME (GxB_MAX_ISNE_INT32) ; + GETNAME (GxB_MAX_ISNE_INT64) ; + GETNAME (GxB_MAX_ISNE_UINT8) ; + GETNAME (GxB_MAX_ISNE_UINT16) ; + GETNAME (GxB_MAX_ISNE_UINT32) ; + GETNAME (GxB_MAX_ISNE_UINT64) ; + GETNAME (GxB_MAX_ISNE_FP32) ; + GETNAME (GxB_MAX_ISNE_FP64) ; + + GETNAME (GxB_PLUS_ISNE_INT8) ; + GETNAME (GxB_PLUS_ISNE_INT16) ; + GETNAME (GxB_PLUS_ISNE_INT32) ; + GETNAME (GxB_PLUS_ISNE_INT64) ; + GETNAME (GxB_PLUS_ISNE_UINT8) ; + GETNAME (GxB_PLUS_ISNE_UINT16) ; + GETNAME (GxB_PLUS_ISNE_UINT32) ; + GETNAME (GxB_PLUS_ISNE_UINT64) ; + GETNAME (GxB_PLUS_ISNE_FP32) ; + GETNAME (GxB_PLUS_ISNE_FP64) ; + + GETNAME (GxB_TIMES_ISNE_INT8) ; + GETNAME (GxB_TIMES_ISNE_INT16) ; + GETNAME (GxB_TIMES_ISNE_INT32) ; + GETNAME (GxB_TIMES_ISNE_INT64) ; + GETNAME (GxB_TIMES_ISNE_UINT8) ; + GETNAME (GxB_TIMES_ISNE_UINT16) ; + GETNAME (GxB_TIMES_ISNE_UINT32) ; + GETNAME (GxB_TIMES_ISNE_UINT64) ; + GETNAME (GxB_TIMES_ISNE_FP32) ; + GETNAME (GxB_TIMES_ISNE_FP64) ; + + GETNAME (GxB_ANY_ISNE_INT8) ; + GETNAME (GxB_ANY_ISNE_INT16) ; + GETNAME (GxB_ANY_ISNE_INT32) ; + GETNAME (GxB_ANY_ISNE_INT64) ; + GETNAME (GxB_ANY_ISNE_UINT8) ; + GETNAME (GxB_ANY_ISNE_UINT16) ; + GETNAME (GxB_ANY_ISNE_UINT32) ; + GETNAME (GxB_ANY_ISNE_UINT64) ; + GETNAME (GxB_ANY_ISNE_FP32) ; + GETNAME (GxB_ANY_ISNE_FP64) ; + + //-------------------------------------------------------------------------- + // *_ISGT + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_ISGT_INT8) ; + GETNAME (GxB_MIN_ISGT_INT16) ; + GETNAME (GxB_MIN_ISGT_INT32) ; + GETNAME (GxB_MIN_ISGT_INT64) ; + GETNAME (GxB_MIN_ISGT_UINT8) ; + GETNAME (GxB_MIN_ISGT_UINT16) ; + GETNAME (GxB_MIN_ISGT_UINT32) ; + GETNAME (GxB_MIN_ISGT_UINT64) ; + GETNAME (GxB_MIN_ISGT_FP32) ; + GETNAME (GxB_MIN_ISGT_FP64) ; + + GETNAME (GxB_MAX_ISGT_INT8) ; + GETNAME (GxB_MAX_ISGT_INT16) ; + GETNAME (GxB_MAX_ISGT_INT32) ; + GETNAME (GxB_MAX_ISGT_INT64) ; + GETNAME (GxB_MAX_ISGT_UINT8) ; + GETNAME (GxB_MAX_ISGT_UINT16) ; + GETNAME (GxB_MAX_ISGT_UINT32) ; + GETNAME (GxB_MAX_ISGT_UINT64) ; + GETNAME (GxB_MAX_ISGT_FP32) ; + GETNAME (GxB_MAX_ISGT_FP64) ; + + GETNAME (GxB_PLUS_ISGT_INT8) ; + GETNAME (GxB_PLUS_ISGT_INT16) ; + GETNAME (GxB_PLUS_ISGT_INT32) ; + GETNAME (GxB_PLUS_ISGT_INT64) ; + GETNAME (GxB_PLUS_ISGT_UINT8) ; + GETNAME (GxB_PLUS_ISGT_UINT16) ; + GETNAME (GxB_PLUS_ISGT_UINT32) ; + GETNAME (GxB_PLUS_ISGT_UINT64) ; + GETNAME (GxB_PLUS_ISGT_FP32) ; + GETNAME (GxB_PLUS_ISGT_FP64) ; + + GETNAME (GxB_TIMES_ISGT_INT8) ; + GETNAME (GxB_TIMES_ISGT_INT16) ; + GETNAME (GxB_TIMES_ISGT_INT32) ; + GETNAME (GxB_TIMES_ISGT_INT64) ; + GETNAME (GxB_TIMES_ISGT_UINT8) ; + GETNAME (GxB_TIMES_ISGT_UINT16) ; + GETNAME (GxB_TIMES_ISGT_UINT32) ; + GETNAME (GxB_TIMES_ISGT_UINT64) ; + GETNAME (GxB_TIMES_ISGT_FP32) ; + GETNAME (GxB_TIMES_ISGT_FP64) ; + + GETNAME (GxB_ANY_ISGT_INT8) ; + GETNAME (GxB_ANY_ISGT_INT16) ; + GETNAME (GxB_ANY_ISGT_INT32) ; + GETNAME (GxB_ANY_ISGT_INT64) ; + GETNAME (GxB_ANY_ISGT_UINT8) ; + GETNAME (GxB_ANY_ISGT_UINT16) ; + GETNAME (GxB_ANY_ISGT_UINT32) ; + GETNAME (GxB_ANY_ISGT_UINT64) ; + GETNAME (GxB_ANY_ISGT_FP32) ; + GETNAME (GxB_ANY_ISGT_FP64) ; + + //-------------------------------------------------------------------------- + // *_ISLT + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_ISLT_INT8) ; + GETNAME (GxB_MIN_ISLT_INT16) ; + GETNAME (GxB_MIN_ISLT_INT32) ; + GETNAME (GxB_MIN_ISLT_INT64) ; + GETNAME (GxB_MIN_ISLT_UINT8) ; + GETNAME (GxB_MIN_ISLT_UINT16) ; + GETNAME (GxB_MIN_ISLT_UINT32) ; + GETNAME (GxB_MIN_ISLT_UINT64) ; + GETNAME (GxB_MIN_ISLT_FP32) ; + GETNAME (GxB_MIN_ISLT_FP64) ; + + GETNAME (GxB_MAX_ISLT_INT8) ; + GETNAME (GxB_MAX_ISLT_INT16) ; + GETNAME (GxB_MAX_ISLT_INT32) ; + GETNAME (GxB_MAX_ISLT_INT64) ; + GETNAME (GxB_MAX_ISLT_UINT8) ; + GETNAME (GxB_MAX_ISLT_UINT16) ; + GETNAME (GxB_MAX_ISLT_UINT32) ; + GETNAME (GxB_MAX_ISLT_UINT64) ; + GETNAME (GxB_MAX_ISLT_FP32) ; + GETNAME (GxB_MAX_ISLT_FP64) ; + + GETNAME (GxB_PLUS_ISLT_INT8) ; + GETNAME (GxB_PLUS_ISLT_INT16) ; + GETNAME (GxB_PLUS_ISLT_INT32) ; + GETNAME (GxB_PLUS_ISLT_INT64) ; + GETNAME (GxB_PLUS_ISLT_UINT8) ; + GETNAME (GxB_PLUS_ISLT_UINT16) ; + GETNAME (GxB_PLUS_ISLT_UINT32) ; + GETNAME (GxB_PLUS_ISLT_UINT64) ; + GETNAME (GxB_PLUS_ISLT_FP32) ; + GETNAME (GxB_PLUS_ISLT_FP64) ; + + GETNAME (GxB_TIMES_ISLT_INT8) ; + GETNAME (GxB_TIMES_ISLT_INT16) ; + GETNAME (GxB_TIMES_ISLT_INT32) ; + GETNAME (GxB_TIMES_ISLT_INT64) ; + GETNAME (GxB_TIMES_ISLT_UINT8) ; + GETNAME (GxB_TIMES_ISLT_UINT16) ; + GETNAME (GxB_TIMES_ISLT_UINT32) ; + GETNAME (GxB_TIMES_ISLT_UINT64) ; + GETNAME (GxB_TIMES_ISLT_FP32) ; + GETNAME (GxB_TIMES_ISLT_FP64) ; + + GETNAME (GxB_ANY_ISLT_INT8) ; + GETNAME (GxB_ANY_ISLT_INT16) ; + GETNAME (GxB_ANY_ISLT_INT32) ; + GETNAME (GxB_ANY_ISLT_INT64) ; + GETNAME (GxB_ANY_ISLT_UINT8) ; + GETNAME (GxB_ANY_ISLT_UINT16) ; + GETNAME (GxB_ANY_ISLT_UINT32) ; + GETNAME (GxB_ANY_ISLT_UINT64) ; + GETNAME (GxB_ANY_ISLT_FP32) ; + GETNAME (GxB_ANY_ISLT_FP64) ; + + //-------------------------------------------------------------------------- + // *_ISGE + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_ISGE_INT8) ; + GETNAME (GxB_MIN_ISGE_INT16) ; + GETNAME (GxB_MIN_ISGE_INT32) ; + GETNAME (GxB_MIN_ISGE_INT64) ; + GETNAME (GxB_MIN_ISGE_UINT8) ; + GETNAME (GxB_MIN_ISGE_UINT16) ; + GETNAME (GxB_MIN_ISGE_UINT32) ; + GETNAME (GxB_MIN_ISGE_UINT64) ; + GETNAME (GxB_MIN_ISGE_FP32) ; + GETNAME (GxB_MIN_ISGE_FP64) ; + + GETNAME (GxB_MAX_ISGE_INT8) ; + GETNAME (GxB_MAX_ISGE_INT16) ; + GETNAME (GxB_MAX_ISGE_INT32) ; + GETNAME (GxB_MAX_ISGE_INT64) ; + GETNAME (GxB_MAX_ISGE_UINT8) ; + GETNAME (GxB_MAX_ISGE_UINT16) ; + GETNAME (GxB_MAX_ISGE_UINT32) ; + GETNAME (GxB_MAX_ISGE_UINT64) ; + GETNAME (GxB_MAX_ISGE_FP32) ; + GETNAME (GxB_MAX_ISGE_FP64) ; + + GETNAME (GxB_PLUS_ISGE_INT8) ; + GETNAME (GxB_PLUS_ISGE_INT16) ; + GETNAME (GxB_PLUS_ISGE_INT32) ; + GETNAME (GxB_PLUS_ISGE_INT64) ; + GETNAME (GxB_PLUS_ISGE_UINT8) ; + GETNAME (GxB_PLUS_ISGE_UINT16) ; + GETNAME (GxB_PLUS_ISGE_UINT32) ; + GETNAME (GxB_PLUS_ISGE_UINT64) ; + GETNAME (GxB_PLUS_ISGE_FP32) ; + GETNAME (GxB_PLUS_ISGE_FP64) ; + + GETNAME (GxB_TIMES_ISGE_INT8) ; + GETNAME (GxB_TIMES_ISGE_INT16) ; + GETNAME (GxB_TIMES_ISGE_INT32) ; + GETNAME (GxB_TIMES_ISGE_INT64) ; + GETNAME (GxB_TIMES_ISGE_UINT8) ; + GETNAME (GxB_TIMES_ISGE_UINT16) ; + GETNAME (GxB_TIMES_ISGE_UINT32) ; + GETNAME (GxB_TIMES_ISGE_UINT64) ; + GETNAME (GxB_TIMES_ISGE_FP32) ; + GETNAME (GxB_TIMES_ISGE_FP64) ; + + GETNAME (GxB_ANY_ISGE_INT8) ; + GETNAME (GxB_ANY_ISGE_INT16) ; + GETNAME (GxB_ANY_ISGE_INT32) ; + GETNAME (GxB_ANY_ISGE_INT64) ; + GETNAME (GxB_ANY_ISGE_UINT8) ; + GETNAME (GxB_ANY_ISGE_UINT16) ; + GETNAME (GxB_ANY_ISGE_UINT32) ; + GETNAME (GxB_ANY_ISGE_UINT64) ; + GETNAME (GxB_ANY_ISGE_FP32) ; + GETNAME (GxB_ANY_ISGE_FP64) ; + + //-------------------------------------------------------------------------- + // *_ISLE + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_ISLE_INT8) ; + GETNAME (GxB_MIN_ISLE_INT16) ; + GETNAME (GxB_MIN_ISLE_INT32) ; + GETNAME (GxB_MIN_ISLE_INT64) ; + GETNAME (GxB_MIN_ISLE_UINT8) ; + GETNAME (GxB_MIN_ISLE_UINT16) ; + GETNAME (GxB_MIN_ISLE_UINT32) ; + GETNAME (GxB_MIN_ISLE_UINT64) ; + GETNAME (GxB_MIN_ISLE_FP32) ; + GETNAME (GxB_MIN_ISLE_FP64) ; + + GETNAME (GxB_MAX_ISLE_INT8) ; + GETNAME (GxB_MAX_ISLE_INT16) ; + GETNAME (GxB_MAX_ISLE_INT32) ; + GETNAME (GxB_MAX_ISLE_INT64) ; + GETNAME (GxB_MAX_ISLE_UINT8) ; + GETNAME (GxB_MAX_ISLE_UINT16) ; + GETNAME (GxB_MAX_ISLE_UINT32) ; + GETNAME (GxB_MAX_ISLE_UINT64) ; + GETNAME (GxB_MAX_ISLE_FP32) ; + GETNAME (GxB_MAX_ISLE_FP64) ; + + GETNAME (GxB_PLUS_ISLE_INT8) ; + GETNAME (GxB_PLUS_ISLE_INT16) ; + GETNAME (GxB_PLUS_ISLE_INT32) ; + GETNAME (GxB_PLUS_ISLE_INT64) ; + GETNAME (GxB_PLUS_ISLE_UINT8) ; + GETNAME (GxB_PLUS_ISLE_UINT16) ; + GETNAME (GxB_PLUS_ISLE_UINT32) ; + GETNAME (GxB_PLUS_ISLE_UINT64) ; + GETNAME (GxB_PLUS_ISLE_FP32) ; + GETNAME (GxB_PLUS_ISLE_FP64) ; + + GETNAME (GxB_TIMES_ISLE_INT8) ; + GETNAME (GxB_TIMES_ISLE_INT16) ; + GETNAME (GxB_TIMES_ISLE_INT32) ; + GETNAME (GxB_TIMES_ISLE_INT64) ; + GETNAME (GxB_TIMES_ISLE_UINT8) ; + GETNAME (GxB_TIMES_ISLE_UINT16) ; + GETNAME (GxB_TIMES_ISLE_UINT32) ; + GETNAME (GxB_TIMES_ISLE_UINT64) ; + GETNAME (GxB_TIMES_ISLE_FP32) ; + GETNAME (GxB_TIMES_ISLE_FP64) ; + + GETNAME (GxB_ANY_ISLE_INT8) ; + GETNAME (GxB_ANY_ISLE_INT16) ; + GETNAME (GxB_ANY_ISLE_INT32) ; + GETNAME (GxB_ANY_ISLE_INT64) ; + GETNAME (GxB_ANY_ISLE_UINT8) ; + GETNAME (GxB_ANY_ISLE_UINT16) ; + GETNAME (GxB_ANY_ISLE_UINT32) ; + GETNAME (GxB_ANY_ISLE_UINT64) ; + GETNAME (GxB_ANY_ISLE_FP32) ; + GETNAME (GxB_ANY_ISLE_FP64) ; + + //-------------------------------------------------------------------------- + // *_LOR + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_LOR_INT8) ; + GETNAME (GxB_MIN_LOR_INT16) ; + GETNAME (GxB_MIN_LOR_INT32) ; + GETNAME (GxB_MIN_LOR_INT64) ; + GETNAME (GxB_MIN_LOR_UINT8) ; + GETNAME (GxB_MIN_LOR_UINT16) ; + GETNAME (GxB_MIN_LOR_UINT32) ; + GETNAME (GxB_MIN_LOR_UINT64) ; + GETNAME (GxB_MIN_LOR_FP32) ; + GETNAME (GxB_MIN_LOR_FP64) ; + + GETNAME (GxB_MAX_LOR_INT8) ; + GETNAME (GxB_MAX_LOR_INT16) ; + GETNAME (GxB_MAX_LOR_INT32) ; + GETNAME (GxB_MAX_LOR_INT64) ; + GETNAME (GxB_MAX_LOR_UINT8) ; + GETNAME (GxB_MAX_LOR_UINT16) ; + GETNAME (GxB_MAX_LOR_UINT32) ; + GETNAME (GxB_MAX_LOR_UINT64) ; + GETNAME (GxB_MAX_LOR_FP32) ; + GETNAME (GxB_MAX_LOR_FP64) ; + + GETNAME (GxB_PLUS_LOR_INT8) ; + GETNAME (GxB_PLUS_LOR_INT16) ; + GETNAME (GxB_PLUS_LOR_INT32) ; + GETNAME (GxB_PLUS_LOR_INT64) ; + GETNAME (GxB_PLUS_LOR_UINT8) ; + GETNAME (GxB_PLUS_LOR_UINT16) ; + GETNAME (GxB_PLUS_LOR_UINT32) ; + GETNAME (GxB_PLUS_LOR_UINT64) ; + GETNAME (GxB_PLUS_LOR_FP32) ; + GETNAME (GxB_PLUS_LOR_FP64) ; + + GETNAME (GxB_TIMES_LOR_INT8) ; + GETNAME (GxB_TIMES_LOR_INT16) ; + GETNAME (GxB_TIMES_LOR_INT32) ; + GETNAME (GxB_TIMES_LOR_INT64) ; + GETNAME (GxB_TIMES_LOR_UINT8) ; + GETNAME (GxB_TIMES_LOR_UINT16) ; + GETNAME (GxB_TIMES_LOR_UINT32) ; + GETNAME (GxB_TIMES_LOR_UINT64) ; + GETNAME (GxB_TIMES_LOR_FP32) ; + GETNAME (GxB_TIMES_LOR_FP64) ; + + GETNAME (GxB_ANY_LOR_INT8) ; + GETNAME (GxB_ANY_LOR_INT16) ; + GETNAME (GxB_ANY_LOR_INT32) ; + GETNAME (GxB_ANY_LOR_INT64) ; + GETNAME (GxB_ANY_LOR_UINT8) ; + GETNAME (GxB_ANY_LOR_UINT16) ; + GETNAME (GxB_ANY_LOR_UINT32) ; + GETNAME (GxB_ANY_LOR_UINT64) ; + GETNAME (GxB_ANY_LOR_FP32) ; + GETNAME (GxB_ANY_LOR_FP64) ; + + GETNAME (GxB_LOR_LOR_BOOL) ; + GETNAME (GxB_LXOR_LOR_BOOL) ; + GETNAME (GxB_ANY_LOR_BOOL) ; + + GETNAM2 (GxB_LAND_LOR_BOOL, "GrB_LAND_LOR_SEMIRING_BOOL") ; + GETNAME (GrB_LAND_LOR_SEMIRING_BOOL) ; + + GETNAM2 (GxB_EQ_LOR_BOOL, "GrB_LXNOR_LOR_SEMIRING_BOOL") ; + GETNAME (GrB_LXNOR_LOR_SEMIRING_BOOL) ; + + //-------------------------------------------------------------------------- + // *_LAND + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_LAND_INT8) ; + GETNAME (GxB_MIN_LAND_INT16) ; + GETNAME (GxB_MIN_LAND_INT32) ; + GETNAME (GxB_MIN_LAND_INT64) ; + GETNAME (GxB_MIN_LAND_UINT8) ; + GETNAME (GxB_MIN_LAND_UINT16) ; + GETNAME (GxB_MIN_LAND_UINT32) ; + GETNAME (GxB_MIN_LAND_UINT64) ; + GETNAME (GxB_MIN_LAND_FP32) ; + GETNAME (GxB_MIN_LAND_FP64) ; + + GETNAME (GxB_MAX_LAND_INT8) ; + GETNAME (GxB_MAX_LAND_INT16) ; + GETNAME (GxB_MAX_LAND_INT32) ; + GETNAME (GxB_MAX_LAND_INT64) ; + GETNAME (GxB_MAX_LAND_UINT8) ; + GETNAME (GxB_MAX_LAND_UINT16) ; + GETNAME (GxB_MAX_LAND_UINT32) ; + GETNAME (GxB_MAX_LAND_UINT64) ; + GETNAME (GxB_MAX_LAND_FP32) ; + GETNAME (GxB_MAX_LAND_FP64) ; + + GETNAME (GxB_PLUS_LAND_INT8) ; + GETNAME (GxB_PLUS_LAND_INT16) ; + GETNAME (GxB_PLUS_LAND_INT32) ; + GETNAME (GxB_PLUS_LAND_INT64) ; + GETNAME (GxB_PLUS_LAND_UINT8) ; + GETNAME (GxB_PLUS_LAND_UINT16) ; + GETNAME (GxB_PLUS_LAND_UINT32) ; + GETNAME (GxB_PLUS_LAND_UINT64) ; + GETNAME (GxB_PLUS_LAND_FP32) ; + GETNAME (GxB_PLUS_LAND_FP64) ; + + GETNAME (GxB_TIMES_LAND_INT8) ; + GETNAME (GxB_TIMES_LAND_INT16) ; + GETNAME (GxB_TIMES_LAND_INT32) ; + GETNAME (GxB_TIMES_LAND_INT64) ; + GETNAME (GxB_TIMES_LAND_UINT8) ; + GETNAME (GxB_TIMES_LAND_UINT16) ; + GETNAME (GxB_TIMES_LAND_UINT32) ; + GETNAME (GxB_TIMES_LAND_UINT64) ; + GETNAME (GxB_TIMES_LAND_FP32) ; + GETNAME (GxB_TIMES_LAND_FP64) ; + + GETNAME (GxB_ANY_LAND_INT8) ; + GETNAME (GxB_ANY_LAND_INT16) ; + GETNAME (GxB_ANY_LAND_INT32) ; + GETNAME (GxB_ANY_LAND_INT64) ; + GETNAME (GxB_ANY_LAND_UINT8) ; + GETNAME (GxB_ANY_LAND_UINT16) ; + GETNAME (GxB_ANY_LAND_UINT32) ; + GETNAME (GxB_ANY_LAND_UINT64) ; + GETNAME (GxB_ANY_LAND_FP32) ; + GETNAME (GxB_ANY_LAND_FP64) ; + + GETNAME (GxB_LAND_LAND_BOOL) ; + GETNAME (GxB_ANY_LAND_BOOL) ; + GETNAME (GxB_EQ_LAND_BOOL) ; + + GETNAM2 (GxB_LOR_LAND_BOOL, "GrB_LOR_LAND_SEMIRING_BOOL") ; + GETNAME (GrB_LOR_LAND_SEMIRING_BOOL) ; + + GETNAM2 (GxB_LXOR_LAND_BOOL, "GrB_LXOR_LAND_SEMIRING_BOOL") ; + GETNAME (GrB_LXOR_LAND_SEMIRING_BOOL) ; + + //-------------------------------------------------------------------------- + // *_LXOR + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_LXOR_INT8) ; + GETNAME (GxB_MIN_LXOR_INT16) ; + GETNAME (GxB_MIN_LXOR_INT32) ; + GETNAME (GxB_MIN_LXOR_INT64) ; + GETNAME (GxB_MIN_LXOR_UINT8) ; + GETNAME (GxB_MIN_LXOR_UINT16) ; + GETNAME (GxB_MIN_LXOR_UINT32) ; + GETNAME (GxB_MIN_LXOR_UINT64) ; + GETNAME (GxB_MIN_LXOR_FP32) ; + GETNAME (GxB_MIN_LXOR_FP64) ; + + GETNAME (GxB_MAX_LXOR_INT8) ; + GETNAME (GxB_MAX_LXOR_INT16) ; + GETNAME (GxB_MAX_LXOR_INT32) ; + GETNAME (GxB_MAX_LXOR_INT64) ; + GETNAME (GxB_MAX_LXOR_UINT8) ; + GETNAME (GxB_MAX_LXOR_UINT16) ; + GETNAME (GxB_MAX_LXOR_UINT32) ; + GETNAME (GxB_MAX_LXOR_UINT64) ; + GETNAME (GxB_MAX_LXOR_FP32) ; + GETNAME (GxB_MAX_LXOR_FP64) ; + + GETNAME (GxB_PLUS_LXOR_INT8) ; + GETNAME (GxB_PLUS_LXOR_INT16) ; + GETNAME (GxB_PLUS_LXOR_INT32) ; + GETNAME (GxB_PLUS_LXOR_INT64) ; + GETNAME (GxB_PLUS_LXOR_UINT8) ; + GETNAME (GxB_PLUS_LXOR_UINT16) ; + GETNAME (GxB_PLUS_LXOR_UINT32) ; + GETNAME (GxB_PLUS_LXOR_UINT64) ; + GETNAME (GxB_PLUS_LXOR_FP32) ; + GETNAME (GxB_PLUS_LXOR_FP64) ; + + GETNAME (GxB_TIMES_LXOR_INT8) ; + GETNAME (GxB_TIMES_LXOR_INT16) ; + GETNAME (GxB_TIMES_LXOR_INT32) ; + GETNAME (GxB_TIMES_LXOR_INT64) ; + GETNAME (GxB_TIMES_LXOR_UINT8) ; + GETNAME (GxB_TIMES_LXOR_UINT16) ; + GETNAME (GxB_TIMES_LXOR_UINT32) ; + GETNAME (GxB_TIMES_LXOR_UINT64) ; + GETNAME (GxB_TIMES_LXOR_FP32) ; + GETNAME (GxB_TIMES_LXOR_FP64) ; + + GETNAME (GxB_ANY_LXOR_INT8) ; + GETNAME (GxB_ANY_LXOR_INT16) ; + GETNAME (GxB_ANY_LXOR_INT32) ; + GETNAME (GxB_ANY_LXOR_INT64) ; + GETNAME (GxB_ANY_LXOR_UINT8) ; + GETNAME (GxB_ANY_LXOR_UINT16) ; + GETNAME (GxB_ANY_LXOR_UINT32) ; + GETNAME (GxB_ANY_LXOR_UINT64) ; + GETNAME (GxB_ANY_LXOR_FP32) ; + GETNAME (GxB_ANY_LXOR_FP64) ; + + GETNAME (GxB_LOR_LXOR_BOOL) ; + GETNAME (GxB_LAND_LXOR_BOOL) ; + GETNAME (GxB_LXOR_LXOR_BOOL) ; + GETNAME (GxB_EQ_LXOR_BOOL) ; + GETNAME (GxB_ANY_LXOR_BOOL) ; + + //-------------------------------------------------------------------------- + // *_EQ + //-------------------------------------------------------------------------- + + GETNAME (GxB_LOR_EQ_INT8) ; + GETNAME (GxB_LOR_EQ_INT16) ; + GETNAME (GxB_LOR_EQ_INT32) ; + GETNAME (GxB_LOR_EQ_INT64) ; + GETNAME (GxB_LOR_EQ_UINT8) ; + GETNAME (GxB_LOR_EQ_UINT16) ; + GETNAME (GxB_LOR_EQ_UINT32) ; + GETNAME (GxB_LOR_EQ_UINT64) ; + GETNAME (GxB_LOR_EQ_FP32) ; + GETNAME (GxB_LOR_EQ_FP64) ; + + GETNAME (GxB_LAND_EQ_INT8) ; + GETNAME (GxB_LAND_EQ_INT16) ; + GETNAME (GxB_LAND_EQ_INT32) ; + GETNAME (GxB_LAND_EQ_INT64) ; + GETNAME (GxB_LAND_EQ_UINT8) ; + GETNAME (GxB_LAND_EQ_UINT16) ; + GETNAME (GxB_LAND_EQ_UINT32) ; + GETNAME (GxB_LAND_EQ_UINT64) ; + GETNAME (GxB_LAND_EQ_FP32) ; + GETNAME (GxB_LAND_EQ_FP64) ; + + GETNAME (GxB_LXOR_EQ_INT8) ; + GETNAME (GxB_LXOR_EQ_INT16) ; + GETNAME (GxB_LXOR_EQ_INT32) ; + GETNAME (GxB_LXOR_EQ_INT64) ; + GETNAME (GxB_LXOR_EQ_UINT8) ; + GETNAME (GxB_LXOR_EQ_UINT16) ; + GETNAME (GxB_LXOR_EQ_UINT32) ; + GETNAME (GxB_LXOR_EQ_UINT64) ; + GETNAME (GxB_LXOR_EQ_FP32) ; + GETNAME (GxB_LXOR_EQ_FP64) ; + + GETNAME (GxB_EQ_EQ_INT8) ; + GETNAME (GxB_EQ_EQ_INT16) ; + GETNAME (GxB_EQ_EQ_INT32) ; + GETNAME (GxB_EQ_EQ_INT64) ; + GETNAME (GxB_EQ_EQ_UINT8) ; + GETNAME (GxB_EQ_EQ_UINT16) ; + GETNAME (GxB_EQ_EQ_UINT32) ; + GETNAME (GxB_EQ_EQ_UINT64) ; + GETNAME (GxB_EQ_EQ_FP32) ; + GETNAME (GxB_EQ_EQ_FP64) ; + + GETNAME (GxB_ANY_EQ_INT8) ; + GETNAME (GxB_ANY_EQ_INT16) ; + GETNAME (GxB_ANY_EQ_INT32) ; + GETNAME (GxB_ANY_EQ_INT64) ; + GETNAME (GxB_ANY_EQ_UINT8) ; + GETNAME (GxB_ANY_EQ_UINT16) ; + GETNAME (GxB_ANY_EQ_UINT32) ; + GETNAME (GxB_ANY_EQ_UINT64) ; + GETNAME (GxB_ANY_EQ_FP32) ; + GETNAME (GxB_ANY_EQ_FP64) ; + + GETNAME (GxB_LOR_EQ_BOOL) ; + GETNAME (GxB_LAND_EQ_BOOL) ; + GETNAME (GxB_LXOR_EQ_BOOL) ; + GETNAME (GxB_EQ_EQ_BOOL) ; + GETNAME (GxB_ANY_EQ_BOOL) ; + + //-------------------------------------------------------------------------- + // *_NE + //-------------------------------------------------------------------------- + + GETNAME (GxB_LOR_NE_INT8) ; + GETNAME (GxB_LOR_NE_INT16) ; + GETNAME (GxB_LOR_NE_INT32) ; + GETNAME (GxB_LOR_NE_INT64) ; + GETNAME (GxB_LOR_NE_UINT8) ; + GETNAME (GxB_LOR_NE_UINT16) ; + GETNAME (GxB_LOR_NE_UINT32) ; + GETNAME (GxB_LOR_NE_UINT64) ; + GETNAME (GxB_LOR_NE_FP32) ; + GETNAME (GxB_LOR_NE_FP64) ; + + GETNAME (GxB_LAND_NE_INT8) ; + GETNAME (GxB_LAND_NE_INT16) ; + GETNAME (GxB_LAND_NE_INT32) ; + GETNAME (GxB_LAND_NE_INT64) ; + GETNAME (GxB_LAND_NE_UINT8) ; + GETNAME (GxB_LAND_NE_UINT16) ; + GETNAME (GxB_LAND_NE_UINT32) ; + GETNAME (GxB_LAND_NE_UINT64) ; + GETNAME (GxB_LAND_NE_FP32) ; + GETNAME (GxB_LAND_NE_FP64) ; + + GETNAME (GxB_LXOR_NE_INT8) ; + GETNAME (GxB_LXOR_NE_INT16) ; + GETNAME (GxB_LXOR_NE_INT32) ; + GETNAME (GxB_LXOR_NE_INT64) ; + GETNAME (GxB_LXOR_NE_UINT8) ; + GETNAME (GxB_LXOR_NE_UINT16) ; + GETNAME (GxB_LXOR_NE_UINT32) ; + GETNAME (GxB_LXOR_NE_UINT64) ; + GETNAME (GxB_LXOR_NE_FP32) ; + GETNAME (GxB_LXOR_NE_FP64) ; + + GETNAME (GxB_EQ_NE_INT8) ; + GETNAME (GxB_EQ_NE_INT16) ; + GETNAME (GxB_EQ_NE_INT32) ; + GETNAME (GxB_EQ_NE_INT64) ; + GETNAME (GxB_EQ_NE_UINT8) ; + GETNAME (GxB_EQ_NE_UINT16) ; + GETNAME (GxB_EQ_NE_UINT32) ; + GETNAME (GxB_EQ_NE_UINT64) ; + GETNAME (GxB_EQ_NE_FP32) ; + GETNAME (GxB_EQ_NE_FP64) ; + + GETNAME (GxB_ANY_NE_INT8) ; + GETNAME (GxB_ANY_NE_INT16) ; + GETNAME (GxB_ANY_NE_INT32) ; + GETNAME (GxB_ANY_NE_INT64) ; + GETNAME (GxB_ANY_NE_UINT8) ; + GETNAME (GxB_ANY_NE_UINT16) ; + GETNAME (GxB_ANY_NE_UINT32) ; + GETNAME (GxB_ANY_NE_UINT64) ; + GETNAME (GxB_ANY_NE_FP32) ; + GETNAME (GxB_ANY_NE_FP64) ; + + //-------------------------------------------------------------------------- + // *_GT + //-------------------------------------------------------------------------- + + GETNAME (GxB_LOR_GT_INT8) ; + GETNAME (GxB_LOR_GT_INT16) ; + GETNAME (GxB_LOR_GT_INT32) ; + GETNAME (GxB_LOR_GT_INT64) ; + GETNAME (GxB_LOR_GT_UINT8) ; + GETNAME (GxB_LOR_GT_UINT16) ; + GETNAME (GxB_LOR_GT_UINT32) ; + GETNAME (GxB_LOR_GT_UINT64) ; + GETNAME (GxB_LOR_GT_FP32) ; + GETNAME (GxB_LOR_GT_FP64) ; + + GETNAME (GxB_LAND_GT_INT8) ; + GETNAME (GxB_LAND_GT_INT16) ; + GETNAME (GxB_LAND_GT_INT32) ; + GETNAME (GxB_LAND_GT_INT64) ; + GETNAME (GxB_LAND_GT_UINT8) ; + GETNAME (GxB_LAND_GT_UINT16) ; + GETNAME (GxB_LAND_GT_UINT32) ; + GETNAME (GxB_LAND_GT_UINT64) ; + GETNAME (GxB_LAND_GT_FP32) ; + GETNAME (GxB_LAND_GT_FP64) ; + + GETNAME (GxB_LXOR_GT_INT8) ; + GETNAME (GxB_LXOR_GT_INT16) ; + GETNAME (GxB_LXOR_GT_INT32) ; + GETNAME (GxB_LXOR_GT_INT64) ; + GETNAME (GxB_LXOR_GT_UINT8) ; + GETNAME (GxB_LXOR_GT_UINT16) ; + GETNAME (GxB_LXOR_GT_UINT32) ; + GETNAME (GxB_LXOR_GT_UINT64) ; + GETNAME (GxB_LXOR_GT_FP32) ; + GETNAME (GxB_LXOR_GT_FP64) ; + + GETNAME (GxB_EQ_GT_INT8) ; + GETNAME (GxB_EQ_GT_INT16) ; + GETNAME (GxB_EQ_GT_INT32) ; + GETNAME (GxB_EQ_GT_INT64) ; + GETNAME (GxB_EQ_GT_UINT8) ; + GETNAME (GxB_EQ_GT_UINT16) ; + GETNAME (GxB_EQ_GT_UINT32) ; + GETNAME (GxB_EQ_GT_UINT64) ; + GETNAME (GxB_EQ_GT_FP32) ; + GETNAME (GxB_EQ_GT_FP64) ; + + GETNAME (GxB_ANY_GT_INT8) ; + GETNAME (GxB_ANY_GT_INT16) ; + GETNAME (GxB_ANY_GT_INT32) ; + GETNAME (GxB_ANY_GT_INT64) ; + GETNAME (GxB_ANY_GT_UINT8) ; + GETNAME (GxB_ANY_GT_UINT16) ; + GETNAME (GxB_ANY_GT_UINT32) ; + GETNAME (GxB_ANY_GT_UINT64) ; + GETNAME (GxB_ANY_GT_FP32) ; + GETNAME (GxB_ANY_GT_FP64) ; + + GETNAME (GxB_LOR_GT_BOOL) ; + GETNAME (GxB_LAND_GT_BOOL) ; + GETNAME (GxB_LXOR_GT_BOOL) ; + GETNAME (GxB_EQ_GT_BOOL) ; + GETNAME (GxB_ANY_GT_BOOL) ; + + //-------------------------------------------------------------------------- + // *_LT + //-------------------------------------------------------------------------- + + GETNAME (GxB_LOR_LT_INT8) ; + GETNAME (GxB_LOR_LT_INT16) ; + GETNAME (GxB_LOR_LT_INT32) ; + GETNAME (GxB_LOR_LT_INT64) ; + GETNAME (GxB_LOR_LT_UINT8) ; + GETNAME (GxB_LOR_LT_UINT16) ; + GETNAME (GxB_LOR_LT_UINT32) ; + GETNAME (GxB_LOR_LT_UINT64) ; + GETNAME (GxB_LOR_LT_FP32) ; + GETNAME (GxB_LOR_LT_FP64) ; + + GETNAME (GxB_LAND_LT_INT8) ; + GETNAME (GxB_LAND_LT_INT16) ; + GETNAME (GxB_LAND_LT_INT32) ; + GETNAME (GxB_LAND_LT_INT64) ; + GETNAME (GxB_LAND_LT_UINT8) ; + GETNAME (GxB_LAND_LT_UINT16) ; + GETNAME (GxB_LAND_LT_UINT32) ; + GETNAME (GxB_LAND_LT_UINT64) ; + GETNAME (GxB_LAND_LT_FP32) ; + GETNAME (GxB_LAND_LT_FP64) ; + + GETNAME (GxB_LXOR_LT_INT8) ; + GETNAME (GxB_LXOR_LT_INT16) ; + GETNAME (GxB_LXOR_LT_INT32) ; + GETNAME (GxB_LXOR_LT_INT64) ; + GETNAME (GxB_LXOR_LT_UINT8) ; + GETNAME (GxB_LXOR_LT_UINT16) ; + GETNAME (GxB_LXOR_LT_UINT32) ; + GETNAME (GxB_LXOR_LT_UINT64) ; + GETNAME (GxB_LXOR_LT_FP32) ; + GETNAME (GxB_LXOR_LT_FP64) ; + + GETNAME (GxB_EQ_LT_INT8) ; + GETNAME (GxB_EQ_LT_INT16) ; + GETNAME (GxB_EQ_LT_INT32) ; + GETNAME (GxB_EQ_LT_INT64) ; + GETNAME (GxB_EQ_LT_UINT8) ; + GETNAME (GxB_EQ_LT_UINT16) ; + GETNAME (GxB_EQ_LT_UINT32) ; + GETNAME (GxB_EQ_LT_UINT64) ; + GETNAME (GxB_EQ_LT_FP32) ; + GETNAME (GxB_EQ_LT_FP64) ; + + GETNAME (GxB_ANY_LT_INT8) ; + GETNAME (GxB_ANY_LT_INT16) ; + GETNAME (GxB_ANY_LT_INT32) ; + GETNAME (GxB_ANY_LT_INT64) ; + GETNAME (GxB_ANY_LT_UINT8) ; + GETNAME (GxB_ANY_LT_UINT16) ; + GETNAME (GxB_ANY_LT_UINT32) ; + GETNAME (GxB_ANY_LT_UINT64) ; + GETNAME (GxB_ANY_LT_FP32) ; + GETNAME (GxB_ANY_LT_FP64) ; + + GETNAME (GxB_LOR_LT_BOOL) ; + GETNAME (GxB_LAND_LT_BOOL) ; + GETNAME (GxB_LXOR_LT_BOOL) ; + GETNAME (GxB_EQ_LT_BOOL) ; + GETNAME (GxB_ANY_LT_BOOL) ; + + //-------------------------------------------------------------------------- + // *_GE + //-------------------------------------------------------------------------- + + GETNAME (GxB_LOR_GE_INT8) ; + GETNAME (GxB_LOR_GE_INT16) ; + GETNAME (GxB_LOR_GE_INT32) ; + GETNAME (GxB_LOR_GE_INT64) ; + GETNAME (GxB_LOR_GE_UINT8) ; + GETNAME (GxB_LOR_GE_UINT16) ; + GETNAME (GxB_LOR_GE_UINT32) ; + GETNAME (GxB_LOR_GE_UINT64) ; + GETNAME (GxB_LOR_GE_FP32) ; + GETNAME (GxB_LOR_GE_FP64) ; + + GETNAME (GxB_LAND_GE_INT8) ; + GETNAME (GxB_LAND_GE_INT16) ; + GETNAME (GxB_LAND_GE_INT32) ; + GETNAME (GxB_LAND_GE_INT64) ; + GETNAME (GxB_LAND_GE_UINT8) ; + GETNAME (GxB_LAND_GE_UINT16) ; + GETNAME (GxB_LAND_GE_UINT32) ; + GETNAME (GxB_LAND_GE_UINT64) ; + GETNAME (GxB_LAND_GE_FP32) ; + GETNAME (GxB_LAND_GE_FP64) ; + + GETNAME (GxB_LXOR_GE_INT8) ; + GETNAME (GxB_LXOR_GE_INT16) ; + GETNAME (GxB_LXOR_GE_INT32) ; + GETNAME (GxB_LXOR_GE_INT64) ; + GETNAME (GxB_LXOR_GE_UINT8) ; + GETNAME (GxB_LXOR_GE_UINT16) ; + GETNAME (GxB_LXOR_GE_UINT32) ; + GETNAME (GxB_LXOR_GE_UINT64) ; + GETNAME (GxB_LXOR_GE_FP32) ; + GETNAME (GxB_LXOR_GE_FP64) ; + + GETNAME (GxB_EQ_GE_INT8) ; + GETNAME (GxB_EQ_GE_INT16) ; + GETNAME (GxB_EQ_GE_INT32) ; + GETNAME (GxB_EQ_GE_INT64) ; + GETNAME (GxB_EQ_GE_UINT8) ; + GETNAME (GxB_EQ_GE_UINT16) ; + GETNAME (GxB_EQ_GE_UINT32) ; + GETNAME (GxB_EQ_GE_UINT64) ; + GETNAME (GxB_EQ_GE_FP32) ; + GETNAME (GxB_EQ_GE_FP64) ; + + GETNAME (GxB_ANY_GE_INT8) ; + GETNAME (GxB_ANY_GE_INT16) ; + GETNAME (GxB_ANY_GE_INT32) ; + GETNAME (GxB_ANY_GE_INT64) ; + GETNAME (GxB_ANY_GE_UINT8) ; + GETNAME (GxB_ANY_GE_UINT16) ; + GETNAME (GxB_ANY_GE_UINT32) ; + GETNAME (GxB_ANY_GE_UINT64) ; + GETNAME (GxB_ANY_GE_FP32) ; + GETNAME (GxB_ANY_GE_FP64) ; + + GETNAME (GxB_LOR_GE_BOOL) ; + GETNAME (GxB_LAND_GE_BOOL) ; + GETNAME (GxB_LXOR_GE_BOOL) ; + GETNAME (GxB_EQ_GE_BOOL) ; + GETNAME (GxB_ANY_GE_BOOL) ; + + //-------------------------------------------------------------------------- + // *_LE + //-------------------------------------------------------------------------- + + GETNAME (GxB_LOR_LE_INT8) ; + GETNAME (GxB_LOR_LE_INT16) ; + GETNAME (GxB_LOR_LE_INT32) ; + GETNAME (GxB_LOR_LE_INT64) ; + GETNAME (GxB_LOR_LE_UINT8) ; + GETNAME (GxB_LOR_LE_UINT16) ; + GETNAME (GxB_LOR_LE_UINT32) ; + GETNAME (GxB_LOR_LE_UINT64) ; + GETNAME (GxB_LOR_LE_FP32) ; + GETNAME (GxB_LOR_LE_FP64) ; + + GETNAME (GxB_LAND_LE_INT8) ; + GETNAME (GxB_LAND_LE_INT16) ; + GETNAME (GxB_LAND_LE_INT32) ; + GETNAME (GxB_LAND_LE_INT64) ; + GETNAME (GxB_LAND_LE_UINT8) ; + GETNAME (GxB_LAND_LE_UINT16) ; + GETNAME (GxB_LAND_LE_UINT32) ; + GETNAME (GxB_LAND_LE_UINT64) ; + GETNAME (GxB_LAND_LE_FP32) ; + GETNAME (GxB_LAND_LE_FP64) ; + + GETNAME (GxB_LXOR_LE_INT8) ; + GETNAME (GxB_LXOR_LE_INT16) ; + GETNAME (GxB_LXOR_LE_INT32) ; + GETNAME (GxB_LXOR_LE_INT64) ; + GETNAME (GxB_LXOR_LE_UINT8) ; + GETNAME (GxB_LXOR_LE_UINT16) ; + GETNAME (GxB_LXOR_LE_UINT32) ; + GETNAME (GxB_LXOR_LE_UINT64) ; + GETNAME (GxB_LXOR_LE_FP32) ; + GETNAME (GxB_LXOR_LE_FP64) ; + + GETNAME (GxB_EQ_LE_INT8) ; + GETNAME (GxB_EQ_LE_INT16) ; + GETNAME (GxB_EQ_LE_INT32) ; + GETNAME (GxB_EQ_LE_INT64) ; + GETNAME (GxB_EQ_LE_UINT8) ; + GETNAME (GxB_EQ_LE_UINT16) ; + GETNAME (GxB_EQ_LE_UINT32) ; + GETNAME (GxB_EQ_LE_UINT64) ; + GETNAME (GxB_EQ_LE_FP32) ; + GETNAME (GxB_EQ_LE_FP64) ; + + GETNAME (GxB_ANY_LE_INT8) ; + GETNAME (GxB_ANY_LE_INT16) ; + GETNAME (GxB_ANY_LE_INT32) ; + GETNAME (GxB_ANY_LE_INT64) ; + GETNAME (GxB_ANY_LE_UINT8) ; + GETNAME (GxB_ANY_LE_UINT16) ; + GETNAME (GxB_ANY_LE_UINT32) ; + GETNAME (GxB_ANY_LE_UINT64) ; + GETNAME (GxB_ANY_LE_FP32) ; + GETNAME (GxB_ANY_LE_FP64) ; + + GETNAME (GxB_LOR_LE_BOOL) ; + GETNAME (GxB_LAND_LE_BOOL) ; + GETNAME (GxB_LXOR_LE_BOOL) ; + GETNAME (GxB_EQ_LE_BOOL) ; + GETNAME (GxB_ANY_LE_BOOL) ; + + + //-------------------------------------------------------------------------- + // bitwise + //-------------------------------------------------------------------------- + + GETNAME (GxB_BOR_BOR_UINT8) ; + GETNAME (GxB_BOR_BOR_UINT16) ; + GETNAME (GxB_BOR_BOR_UINT32) ; + GETNAME (GxB_BOR_BOR_UINT64) ; + + GETNAME (GxB_BOR_BAND_UINT8) ; + GETNAME (GxB_BOR_BAND_UINT16) ; + GETNAME (GxB_BOR_BAND_UINT32) ; + GETNAME (GxB_BOR_BAND_UINT64) ; + + GETNAME (GxB_BOR_BXOR_UINT8) ; + GETNAME (GxB_BOR_BXOR_UINT16) ; + GETNAME (GxB_BOR_BXOR_UINT32) ; + GETNAME (GxB_BOR_BXOR_UINT64) ; + + GETNAME (GxB_BOR_BXNOR_UINT8) ; + GETNAME (GxB_BOR_BXNOR_UINT16) ; + GETNAME (GxB_BOR_BXNOR_UINT32) ; + GETNAME (GxB_BOR_BXNOR_UINT64) ; + + GETNAME (GxB_BAND_BOR_UINT8) ; + GETNAME (GxB_BAND_BOR_UINT16) ; + GETNAME (GxB_BAND_BOR_UINT32) ; + GETNAME (GxB_BAND_BOR_UINT64) ; + + GETNAME (GxB_BAND_BAND_UINT8) ; + GETNAME (GxB_BAND_BAND_UINT16) ; + GETNAME (GxB_BAND_BAND_UINT32) ; + GETNAME (GxB_BAND_BAND_UINT64) ; + + GETNAME (GxB_BAND_BXOR_UINT8) ; + GETNAME (GxB_BAND_BXOR_UINT16) ; + GETNAME (GxB_BAND_BXOR_UINT32) ; + GETNAME (GxB_BAND_BXOR_UINT64) ; + + GETNAME (GxB_BAND_BXNOR_UINT8) ; + GETNAME (GxB_BAND_BXNOR_UINT16) ; + GETNAME (GxB_BAND_BXNOR_UINT32) ; + GETNAME (GxB_BAND_BXNOR_UINT64) ; + + GETNAME (GxB_BXOR_BOR_UINT8) ; + GETNAME (GxB_BXOR_BOR_UINT16) ; + GETNAME (GxB_BXOR_BOR_UINT32) ; + GETNAME (GxB_BXOR_BOR_UINT64) ; + + GETNAME (GxB_BXOR_BAND_UINT8) ; + GETNAME (GxB_BXOR_BAND_UINT16) ; + GETNAME (GxB_BXOR_BAND_UINT32) ; + GETNAME (GxB_BXOR_BAND_UINT64) ; + + GETNAME (GxB_BXOR_BXOR_UINT8) ; + GETNAME (GxB_BXOR_BXOR_UINT16) ; + GETNAME (GxB_BXOR_BXOR_UINT32) ; + GETNAME (GxB_BXOR_BXOR_UINT64) ; + + GETNAME (GxB_BXOR_BXNOR_UINT8) ; + GETNAME (GxB_BXOR_BXNOR_UINT16) ; + GETNAME (GxB_BXOR_BXNOR_UINT32) ; + GETNAME (GxB_BXOR_BXNOR_UINT64) ; + + + GETNAME (GxB_BXNOR_BOR_UINT8) ; + GETNAME (GxB_BXNOR_BOR_UINT16) ; + GETNAME (GxB_BXNOR_BOR_UINT32) ; + GETNAME (GxB_BXNOR_BOR_UINT64) ; + + GETNAME (GxB_BXNOR_BAND_UINT8) ; + GETNAME (GxB_BXNOR_BAND_UINT16) ; + GETNAME (GxB_BXNOR_BAND_UINT32) ; + GETNAME (GxB_BXNOR_BAND_UINT64) ; + + GETNAME (GxB_BXNOR_BXOR_UINT8) ; + GETNAME (GxB_BXNOR_BXOR_UINT16) ; + GETNAME (GxB_BXNOR_BXOR_UINT32) ; + GETNAME (GxB_BXNOR_BXOR_UINT64) ; + + GETNAME (GxB_BXNOR_BXNOR_UINT8) ; + GETNAME (GxB_BXNOR_BXNOR_UINT16) ; + GETNAME (GxB_BXNOR_BXNOR_UINT32) ; + GETNAME (GxB_BXNOR_BXNOR_UINT64) ; + + //-------------------------------------------------------------------------- + // positional semirings + //-------------------------------------------------------------------------- + + GETNAME (GxB_MIN_FIRSTI_INT32) ; + GETNAME (GxB_MIN_FIRSTI_INT64) ; + + GETNAME (GxB_MAX_FIRSTI_INT32) ; + GETNAME (GxB_MAX_FIRSTI_INT64) ; + + GETNAME (GxB_ANY_FIRSTI_INT32) ; + GETNAME (GxB_ANY_FIRSTI_INT64) ; + + GETNAME (GxB_PLUS_FIRSTI_INT32) ; + GETNAME (GxB_PLUS_FIRSTI_INT64) ; + + GETNAME (GxB_TIMES_FIRSTI_INT32) ; + GETNAME (GxB_TIMES_FIRSTI_INT64) ; + + GETNAME (GxB_MIN_FIRSTI1_INT32) ; + GETNAME (GxB_MIN_FIRSTI1_INT64) ; + + GETNAME (GxB_MAX_FIRSTI1_INT32) ; + GETNAME (GxB_MAX_FIRSTI1_INT64) ; + + GETNAME (GxB_ANY_FIRSTI1_INT32) ; + GETNAME (GxB_ANY_FIRSTI1_INT64) ; + + GETNAME (GxB_PLUS_FIRSTI1_INT32) ; + GETNAME (GxB_PLUS_FIRSTI1_INT64) ; + + GETNAME (GxB_TIMES_FIRSTI1_INT32) ; + GETNAME (GxB_TIMES_FIRSTI1_INT64) ; + + GETNAM2 (GxB_MIN_FIRSTJ_INT32, "GxB_MIN_SECONDI_INT32") ; + GETNAM2 (GxB_MIN_FIRSTJ_INT64, "GxB_MIN_SECONDI_INT64") ; + + GETNAM2 (GxB_MAX_FIRSTJ_INT32, "GxB_MAX_SECONDI_INT32") ; + GETNAM2 (GxB_MAX_FIRSTJ_INT64, "GxB_MAX_SECONDI_INT64") ; + + GETNAM2 (GxB_ANY_FIRSTJ_INT32, "GxB_ANY_SECONDI_INT32") ; + GETNAM2 (GxB_ANY_FIRSTJ_INT64, "GxB_ANY_SECONDI_INT64") ; + + GETNAM2 (GxB_PLUS_FIRSTJ_INT32, "GxB_PLUS_SECONDI_INT32") ; + GETNAM2 (GxB_PLUS_FIRSTJ_INT64, "GxB_PLUS_SECONDI_INT64") ; + + GETNAM2 (GxB_TIMES_FIRSTJ_INT32, "GxB_TIMES_SECONDI_INT32") ; + GETNAM2 (GxB_TIMES_FIRSTJ_INT64, "GxB_TIMES_SECONDI_INT64") ; + + GETNAM2 (GxB_MIN_FIRSTJ1_INT32, "GxB_MIN_SECONDI1_INT32") ; + GETNAM2 (GxB_MIN_FIRSTJ1_INT64, "GxB_MIN_SECONDI1_INT64") ; + + GETNAM2 (GxB_MAX_FIRSTJ1_INT32, "GxB_MAX_SECONDI1_INT32") ; + GETNAM2 (GxB_MAX_FIRSTJ1_INT64, "GxB_MAX_SECONDI1_INT64") ; + + GETNAM2 (GxB_ANY_FIRSTJ1_INT32, "GxB_ANY_SECONDI1_INT32") ; + GETNAM2 (GxB_ANY_FIRSTJ1_INT64, "GxB_ANY_SECONDI1_INT64") ; + + GETNAM2 (GxB_PLUS_FIRSTJ1_INT32, "GxB_PLUS_SECONDI1_INT32") ; + GETNAM2 (GxB_PLUS_FIRSTJ1_INT64, "GxB_PLUS_SECONDI1_INT64") ; + + GETNAM2 (GxB_TIMES_FIRSTJ1_INT32, "GxB_TIMES_SECONDI1_INT32") ; + GETNAM2 (GxB_TIMES_FIRSTJ1_INT64, "GxB_TIMES_SECONDI1_INT64") ; + + GETNAME (GxB_MIN_SECONDI_INT32) ; + GETNAME (GxB_MIN_SECONDI_INT64) ; + + GETNAME (GxB_MAX_SECONDI_INT32) ; + GETNAME (GxB_MAX_SECONDI_INT64) ; + + GETNAME (GxB_ANY_SECONDI_INT32) ; + GETNAME (GxB_ANY_SECONDI_INT64) ; + + GETNAME (GxB_PLUS_SECONDI_INT32) ; + GETNAME (GxB_PLUS_SECONDI_INT64) ; + + GETNAME (GxB_TIMES_SECONDI_INT32) ; + GETNAME (GxB_TIMES_SECONDI_INT64) ; + + GETNAME (GxB_MIN_SECONDI1_INT32) ; + GETNAME (GxB_MIN_SECONDI1_INT64) ; + + GETNAME (GxB_MAX_SECONDI1_INT32) ; + GETNAME (GxB_MAX_SECONDI1_INT64) ; + + GETNAME (GxB_ANY_SECONDI1_INT32) ; + GETNAME (GxB_ANY_SECONDI1_INT64) ; + + GETNAME (GxB_PLUS_SECONDI1_INT32) ; + GETNAME (GxB_PLUS_SECONDI1_INT64) ; + + GETNAME (GxB_TIMES_SECONDI1_INT32) ; + GETNAME (GxB_TIMES_SECONDI1_INT64) ; + + GETNAME (GxB_MIN_SECONDJ_INT32) ; + GETNAME (GxB_MIN_SECONDJ_INT64) ; + + GETNAME (GxB_MAX_SECONDJ_INT32) ; + GETNAME (GxB_MAX_SECONDJ_INT64) ; + + GETNAME (GxB_ANY_SECONDJ_INT32) ; + GETNAME (GxB_ANY_SECONDJ_INT64) ; + + GETNAME (GxB_PLUS_SECONDJ_INT32) ; + GETNAME (GxB_PLUS_SECONDJ_INT64) ; + + GETNAME (GxB_TIMES_SECONDJ_INT32) ; + GETNAME (GxB_TIMES_SECONDJ_INT64) ; + + GETNAME (GxB_MIN_SECONDJ1_INT32) ; + GETNAME (GxB_MIN_SECONDJ1_INT64) ; + + GETNAME (GxB_MAX_SECONDJ1_INT32) ; + GETNAME (GxB_MAX_SECONDJ1_INT64) ; + + GETNAME (GxB_ANY_SECONDJ1_INT32) ; + GETNAME (GxB_ANY_SECONDJ1_INT64) ; + + GETNAME (GxB_PLUS_SECONDJ1_INT32) ; + GETNAME (GxB_PLUS_SECONDJ1_INT64) ; + + GETNAME (GxB_TIMES_SECONDJ1_INT32) ; + GETNAME (GxB_TIMES_SECONDJ1_INT64) ; + + //-------------------------------------------------------------------------- + // other methods + //-------------------------------------------------------------------------- + + OK (GrB_Semiring_get_INT32_(GrB_PLUS_TIMES_SEMIRING_FP32, &code, + GrB_INP0_TYPE_CODE)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_Semiring_get_SIZE_(GrB_PLUS_TIMES_SEMIRING_FP32, &size, + GrB_INP0_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + + OK (GrB_Semiring_get_String_(GrB_PLUS_TIMES_SEMIRING_FP32, name, + GrB_INP0_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GrB_Semiring_get_SIZE_(GrB_MAX_PLUS_SEMIRING_INT32, &size, + GrB_INP1_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_INT32") + 1) ; + + OK (GrB_Semiring_get_String_(GrB_MAX_PLUS_SEMIRING_INT32, name, + GrB_INP1_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_INT32")) ; + + OK (GrB_Semiring_get_INT32_(GrB_PLUS_TIMES_SEMIRING_FP64, &code, + GrB_OUTP_TYPE_CODE)) ; + CHECK (code == GrB_FP64_CODE) ; + + OK (GrB_Semiring_get_SIZE_(GrB_PLUS_TIMES_SEMIRING_FP64, &size, + GrB_OUTP_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_FP64") + 1) ; + + OK (GrB_Semiring_get_String_(GrB_PLUS_TIMES_SEMIRING_FP64, name, + GrB_OUTP_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP64")) ; + + OK (GrB_Semiring_get_Scalar_(GrB_PLUS_TIMES_SEMIRING_FP32, s_int32, + GrB_INP0_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_FP32_CODE) ; + + OK (GrB_Semiring_get_Scalar_(GrB_LOR_LAND_SEMIRING_BOOL, s_int32, + GrB_OUTP_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_BOOL_CODE) ; + + OK (GrB_Semiring_get_INT32_(GrB_PLUS_TIMES_SEMIRING_FP64, &code, + GrB_INP1_TYPE_CODE)) ; + CHECK (code == GrB_FP64_CODE) ; + + OK (GrB_Semiring_get_Scalar_(GrB_LOR_LAND_SEMIRING_BOOL, s_int32, + GrB_INP1_TYPE_CODE)) ; + OK (GrB_Scalar_extractElement_INT32_(&code, s_int32)) ; + CHECK (code == GrB_BOOL_CODE) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Semiring_get_INT32_(GrB_LOR_LAND_SEMIRING_BOOL, &code, + GrB_NAME)) ; + ERR (GrB_Semiring_get_String_(GrB_PLUS_TIMES_SEMIRING_INT32, name, + 999)) ; + + ERR (GrB_Semiring_get_VOID_(GrB_LOR_LAND_SEMIRING_BOOL, nothing, 0)) ; + + OK (GrB_BinaryOp_new (×, mytimes, GrB_FP32, GrB_FP32, GrB_FP32)) ; + OK (GrB_BinaryOp_set_String_(times, "mytimes", GrB_NAME)) ; + METHOD (GrB_BinaryOp_set_String (times, MYTIMES_DEFN, GxB_JIT_C_DEFINITION)) ; + + OK (GrB_BinaryOp_new (&add, myadd, GrB_FP32, GrB_FP32, GrB_FP32)) ; + OK (GrB_BinaryOp_set_String_(add, "myadd", GrB_NAME)) ; + 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)) ; + OK (GrB_Monoid_get_String_(monoid, name, GrB_NAME)) ; + printf ("\nuser monoid: [%s]:%d\n", name, size) ; + CHECK (MATCH (name, "")) ; + CHECK (size == 1) ; + OK (GxB_print (monoid, 3)) ; + + OK (GrB_Semiring_new (&semiring, monoid, times)) ; + + OK (GrB_Semiring_get_SIZE_(semiring, &size, GrB_INP0_TYPE_STRING)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + OK (GrB_Semiring_get_String(semiring, name, GrB_INP0_TYPE_STRING)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Semiring_get_SIZE_(semiring, &size, GrB_INP0_TYPE_CODE)) ; + ERR (GrB_Semiring_set_String_(GrB_MAX_TIMES_SEMIRING_INT32, "stuff", + GrB_NAME)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Semiring_set_Scalar_(semiring, s_int32, 0)) ; + ERR (GrB_Semiring_set_INT32_(semiring, 0, 0)) ; + ERR (GrB_Semiring_set_VOID_(semiring, nothing, 0, 0)) ; + + OK (GrB_Semiring_get_String_(semiring, name, GrB_NAME)) ; + CHECK (MATCH (name, "")) ; + OK (GrB_Semiring_set_String_(semiring, "stuff", GrB_NAME)) ; + OK (GrB_Semiring_get_String_(semiring, name, GrB_NAME)) ; + CHECK (MATCH (name, "stuff")) ; + OK (GrB_Semiring_get_SIZE_(semiring, &size, GrB_NAME)) ; + CHECK (size == strlen (name) + 1) ; + OK (GxB_print (semiring, 3)) ; + + expected = GrB_ALREADY_SET ; + ERR (GrB_Semiring_set_String_(semiring, "another user name", GrB_NAME)) ; + printf (" test GrB_ALREADY_SET: ok\n") ; + + printf ("\nsemiring with terminal monoid:\n") ; + int32_t id_int32 ; + OK (GrB_Semiring_get_String_(GrB_MAX_TIMES_SEMIRING_INT32, + name, GrB_NAME)) ; + OK (GxB_Semiring_fprint (GrB_MAX_TIMES_SEMIRING_INT32, name, 3, NULL)) ; + OK (GrB_Monoid_get_Scalar_ (GrB_MAX_TIMES_SEMIRING_INT32, s_int32, + GxB_MONOID_IDENTITY)) ; + OK (GrB_Scalar_nvals (&nvals, s_int32)) ; + CHECK (nvals == 1) ; + OK (GrB_Scalar_extractElement_INT32_(&id_int32, s_int32)) ; + CHECK (id_int32 == INT32_MIN) ; + + int32_t term_int32 ; + OK (GrB_Monoid_get_Scalar_ (GrB_MAX_TIMES_SEMIRING_INT32, s_int32, + GxB_MONOID_TERMINAL)) ; + OK (GrB_Scalar_extractElement_INT32_(&term_int32, s_int32)) ; + CHECK (term_int32 == INT32_MAX) ; + + op = NULL ; + OK (GrB_Semiring_get_SIZE_ (semiring, &size, GxB_MONOID_OPERATOR)) ; + CHECK (size == sizeof (GrB_BinaryOp)) ; + OK (GrB_Semiring_get_VOID (semiring, (void *) (&op), GxB_MONOID_OPERATOR)) ; + CHECK (op == add) ; + OK (GrB_Semiring_get_VOID_ (GrB_PLUS_TIMES_SEMIRING_INT32, (void *) &op, + GxB_MONOID_OPERATOR)) ; + CHECK (op == GrB_PLUS_INT32) ; + + OK (GrB_Semiring_get_SIZE_ (semiring, &size, GxB_SEMIRING_MONOID)) ; + CHECK (size == sizeof (GrB_Monoid)) ; + + OK (GrB_Semiring_get_SIZE_ (semiring, &size, GxB_SEMIRING_MULTIPLY)) ; + CHECK (size == sizeof (GrB_BinaryOp)) ; + + OK (GrB_Semiring_get_VOID_ (semiring, (void *) (&mon), + GxB_SEMIRING_MONOID)) ; + CHECK (mon == monoid) ; + + OK (GrB_Semiring_get_VOID_ (semiring, (void *) (&op), + GxB_SEMIRING_MULTIPLY)) ; + CHECK (op == times) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GrB_free (&add) ; + GrB_free (×) ; + GrB_free (&monoid) ; + GrB_free (&semiring) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test32: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test33.c b/GraphBLAS/Test/GB_mex_test33.c new file mode 100644 index 0000000000..74ef826d17 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test33.c @@ -0,0 +1,157 @@ +//------------------------------------------------------------------------------ +// GB_mex_test33: test GrB_get and GrB_set (context) +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test33" + +#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, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix A = NULL ; + GrB_Vector v = NULL ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL ; + GxB_Context context = NULL ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size ; + char name [256] ; + char defn [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + + //-------------------------------------------------------------------------- + // GxB_Context get/set + //-------------------------------------------------------------------------- + + int32_t nthreads1 = 999, nthreads2 = 777 ; + GxB_get (GxB_NTHREADS, &nthreads1) ; + printf ("nthreads: %d\n", nthreads1) ; + + OK (GxB_Context_get_INT_ (GxB_CONTEXT_WORLD, &nthreads2, GxB_NTHREADS)) ; + printf ("nthreads: %d\n", nthreads2) ; + CHECK (nthreads1 == nthreads2) ; + + OK (GxB_Context_set_INT_ (GxB_CONTEXT_WORLD, 7, GxB_NTHREADS)) ; + OK (GxB_Context_get_INT_ (GxB_CONTEXT_WORLD, &nthreads2, GxB_NTHREADS)) ; + CHECK (nthreads2 == 7) ; + + OK (GxB_Global_Option_get (GxB_NTHREADS, &i)) ; + CHECK (i == 7) ; + + OK (GrB_Scalar_setElement_FP64 (s_int32, 31)) ; + OK (GxB_Context_set_Scalar_ (GxB_CONTEXT_WORLD, s_int32, GxB_NTHREADS)) ; + OK (GxB_Context_get_Scalar_ (GxB_CONTEXT_WORLD, s_fp64, GxB_NTHREADS)) ; + OK (GrB_Scalar_extractElement_FP64 (&dvalue, s_fp64)) ; + CHECK (dvalue == 31) ; + + GxB_set (GxB_NTHREADS, nthreads1) ; + + int32_t gpu ; + OK (GxB_Context_get_INT_ (GxB_CONTEXT_WORLD, &gpu, GxB_GPU_ID)) ; + CHECK (gpu == -1) ; + + gpu = 4 ; + OK (GxB_Context_set_INT_ (GxB_CONTEXT_WORLD, 3, GxB_GPU_ID)) ; + OK (GxB_Context_get_INT_ (GxB_CONTEXT_WORLD, &gpu, GxB_GPU_ID)) ; + CHECK (gpu == -1) ; + + OK (GxB_Context_set_Scalar_ (GxB_CONTEXT_WORLD, s_int32, GxB_GPU_ID)) ; + OK (GxB_Context_get_Scalar_ (GxB_CONTEXT_WORLD, s_fp64, GxB_GPU_ID)) ; + OK (GrB_Scalar_extractElement_FP64 (&dvalue, s_fp64)) ; + CHECK (dvalue == -1) ; + + double chunk ; + OK (GxB_Context_get_Scalar_ (GxB_CONTEXT_WORLD, s_fp64, GxB_CHUNK)) ; + OK (GrB_Scalar_extractElement_FP64 (&chunk, s_fp64)) ; + printf ("chunk: %g\n", chunk) ; + + OK (GrB_Scalar_setElement_FP64 (s_fp64, 2048)) ; + OK (GxB_Context_set_Scalar_ (GxB_CONTEXT_WORLD, s_fp64, GxB_CHUNK)) ; + OK (GxB_Context_get_Scalar_ (GxB_CONTEXT_WORLD, s_fp32, GxB_CHUNK)) ; + OK (GrB_Scalar_extractElement_FP32 (&fvalue, s_fp32)) ; + CHECK (fvalue == 2048) ; + printf ("new chunk: %g\n", fvalue) ; + + OK (GxB_Context_get_SIZE_ (GxB_CONTEXT_WORLD, &size, GrB_NAME)) ; + CHECK (size == GxB_MAX_NAME_LEN) ; + OK (GxB_Context_get_String_ (GxB_CONTEXT_WORLD, name, GrB_NAME)) ; + printf ("name of world [%s]\n", name) ; + CHECK (MATCH (name, "GxB_CONTEXT_WORLD")) ; + + expected = GrB_INVALID_VALUE ; + ERR (GxB_Context_set_String_ (GxB_CONTEXT_WORLD, "newname", GrB_NAME)) ; + 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, GxB_FORMAT)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GxB_Context_get_VOID_ (GxB_CONTEXT_WORLD, nothing, 0)) ; + ERR (GxB_Context_set_VOID_ (GxB_CONTEXT_WORLD, nothing, 0, 0)) ; + ERR (GxB_Context_get_String_ (GxB_CONTEXT_WORLD, name, 999)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GxB_Context_get_INT_ (GxB_CONTEXT_WORLD, &i, GrB_NAME)) ; + ERR (GxB_Context_get_Scalar_ (GxB_CONTEXT_WORLD, s_fp32, GrB_NAME)) ; + ERR (GxB_Context_set_INT_ (GxB_CONTEXT_WORLD, 7, GrB_NAME)) ; + ERR (GxB_Context_set_Scalar_ (GxB_CONTEXT_WORLD, s_fp64, GrB_NAME)) ; + + expected = GrB_EMPTY_OBJECT ; + OK (GrB_Scalar_clear (s_int32)) ; + ERR (GxB_Context_set_Scalar_ (GxB_CONTEXT_WORLD, s_int32, GxB_NTHREADS)) ; + + OK (GxB_Context_new (&context)) ; + OK (GxB_Context_get_String_ (context, name, GrB_NAME)) ; + CHECK (MATCH (name, "")) ; + OK (GxB_Context_set_String_ (context, "another_name", GrB_NAME)) ; + OK (GxB_Context_get_String_ (context, name, GrB_NAME)) ; + CHECK (MATCH (name, "another_name")) ; + OK (GxB_Context_get_SIZE_ (context, &size, GrB_NAME)) ; + CHECK (size == strlen (name) + 1) ; + + OK (GxB_Context_disengage (NULL)) ; + GrB_free (&context) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&A) ; + GrB_free (&v) ; + GrB_free (&s) ; + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test33: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test34.c b/GraphBLAS/Test/GB_mex_test34.c new file mode 100644 index 0000000000..4ec290378b --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test34.c @@ -0,0 +1,466 @@ +//------------------------------------------------------------------------------ +// GB_mex_test34: test GrB_get and GrB_set (descriptor) +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test34" + +#define FREE_ALL ; +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +#define DGET(desc,value,field) \ +{ \ + 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 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 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 +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix A = NULL ; + GrB_Vector v = NULL ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL ; + GrB_Descriptor desc = NULL ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size ; + char name [256] ; + char defn [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + + //-------------------------------------------------------------------------- + // GrB_Descriptor get/set + //-------------------------------------------------------------------------- + +#if 0 + + // OUTP MASK MASK INP0 INP1 + // structural complement + // =========== ============== ========== ======== ======== + +// GrB_NULL // - - - - - +GrB_DESC_T1 , // - - - - GrB_TRAN +GrB_DESC_T0 , // - - - GrB_TRAN - +GrB_DESC_T0T1 , // - - - GrB_TRAN GrB_TRAN + +GrB_DESC_C , // - - GrB_COMP - - +GrB_DESC_CT1 , // - - GrB_COMP - GrB_TRAN +GrB_DESC_CT0 , // - - GrB_COMP GrB_TRAN - +GrB_DESC_CT0T1 , // - - GrB_COMP GrB_TRAN GrB_TRAN + +GrB_DESC_S , // - GrB_STRUCTURE - - - +GrB_DESC_ST1 , // - GrB_STRUCTURE - - GrB_TRAN +GrB_DESC_ST0 , // - GrB_STRUCTURE - GrB_TRAN - +GrB_DESC_ST0T1 , // - GrB_STRUCTURE - GrB_TRAN GrB_TRAN + +GrB_DESC_SC , // - GrB_STRUCTURE GrB_COMP - - +GrB_DESC_SCT1 , // - GrB_STRUCTURE GrB_COMP - GrB_TRAN +GrB_DESC_SCT0 , // - GrB_STRUCTURE GrB_COMP GrB_TRAN - +GrB_DESC_SCT0T1 , // - GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN + +GrB_DESC_R , // GrB_REPLACE - - - - +GrB_DESC_RT1 , // GrB_REPLACE - - - GrB_TRAN +GrB_DESC_RT0 , // GrB_REPLACE - - GrB_TRAN - +GrB_DESC_RT0T1 , // GrB_REPLACE - - GrB_TRAN GrB_TRAN + +GrB_DESC_RC , // GrB_REPLACE - GrB_COMP - - +GrB_DESC_RCT1 , // GrB_REPLACE - GrB_COMP - GrB_TRAN +GrB_DESC_RCT0 , // GrB_REPLACE - GrB_COMP GrB_TRAN - +GrB_DESC_RCT0T1 , // GrB_REPLACE - GrB_COMP GrB_TRAN GrB_TRAN + +GrB_DESC_RS , // GrB_REPLACE GrB_STRUCTURE - - - +GrB_DESC_RST1 , // GrB_REPLACE GrB_STRUCTURE - - GrB_TRAN +GrB_DESC_RST0 , // GrB_REPLACE GrB_STRUCTURE - GrB_TRAN - +GrB_DESC_RST0T1 , // GrB_REPLACE GrB_STRUCTURE - GrB_TRAN GrB_TRAN + +GrB_DESC_RSC , // GrB_REPLACE GrB_STRUCTURE GrB_COMP - - +GrB_DESC_RSCT1 , // GrB_REPLACE GrB_STRUCTURE GrB_COMP - GrB_TRAN +GrB_DESC_RSCT0 , // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN - +GrB_DESC_RSCT0T1 ; // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN + +#endif + + DGET (GrB_NULL , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_T1 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_T0 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_T0T1 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + + DGET (GrB_DESC_C , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_CT1 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_CT0 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_CT0T1 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + + DGET (GrB_DESC_S , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_ST1 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_ST0 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_ST0T1 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + + DGET (GrB_DESC_SC , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_SCT1 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_SCT0 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_SCT0T1 , GrB_DEFAULT, GrB_OUTP_FIELD) ; + + DGET (GrB_DESC_R , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RT1 , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RT0 , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RT0T1 , GrB_REPLACE, GrB_OUTP_FIELD) ; + + DGET (GrB_DESC_RC , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RCT1 , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RCT0 , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RCT0T1 , GrB_REPLACE, GrB_OUTP_FIELD) ; + + DGET (GrB_DESC_RS , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RST1 , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RST0 , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RST0T1 , GrB_REPLACE, GrB_OUTP_FIELD) ; + + DGET (GrB_DESC_RSC , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RSCT1 , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RSCT0 , GrB_REPLACE, GrB_OUTP_FIELD) ; + DGET (GrB_DESC_RSCT0T1 , GrB_REPLACE, GrB_OUTP_FIELD) ; + + + + DGET (GrB_NULL , GrB_DEFAULT, GrB_MASK_FIELD) ; + DGET (GrB_DESC_T1 , GrB_DEFAULT, GrB_MASK_FIELD) ; + DGET (GrB_DESC_T0 , GrB_DEFAULT, GrB_MASK_FIELD) ; + DGET (GrB_DESC_T0T1 , GrB_DEFAULT, GrB_MASK_FIELD) ; + + DGET (GrB_DESC_C , GrB_COMP, GrB_MASK_FIELD) ; + DGET (GrB_DESC_CT1 , GrB_COMP, GrB_MASK_FIELD) ; + DGET (GrB_DESC_CT0 , GrB_COMP, GrB_MASK_FIELD) ; + DGET (GrB_DESC_CT0T1 , GrB_COMP, GrB_MASK_FIELD) ; + + DGET (GrB_DESC_S , GrB_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_ST1 , GrB_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_ST0 , GrB_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_ST0T1 , GrB_STRUCTURE, GrB_MASK_FIELD) ; + + DGET (GrB_DESC_SC , GrB_COMP_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_SCT1 , GrB_COMP_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_SCT0 , GrB_COMP_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_SCT0T1 , GrB_COMP_STRUCTURE, GrB_MASK_FIELD) ; + + DGET (GrB_DESC_R , GrB_DEFAULT, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RT1 , GrB_DEFAULT, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RT0 , GrB_DEFAULT, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RT0T1 , GrB_DEFAULT, GrB_MASK_FIELD) ; + + DGET (GrB_DESC_RC , GrB_COMP, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RCT1 , GrB_COMP, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RCT0 , GrB_COMP, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RCT0T1 , GrB_COMP, GrB_MASK_FIELD) ; + + DGET (GrB_DESC_RS , GrB_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RST1 , GrB_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RST0 , GrB_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RST0T1 , GrB_STRUCTURE, GrB_MASK_FIELD) ; + + DGET (GrB_DESC_RSC , GrB_COMP_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RSCT1 , GrB_COMP_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RSCT0 , GrB_COMP_STRUCTURE, GrB_MASK_FIELD) ; + DGET (GrB_DESC_RSCT0T1 , GrB_COMP_STRUCTURE, GrB_MASK_FIELD) ; + + + + DGET (GrB_NULL , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_T1 , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_T0 , GrB_TRAN , GrB_INP0_FIELD) ; + DGET (GrB_DESC_T0T1 , GrB_TRAN , GrB_INP0_FIELD) ; + + DGET (GrB_DESC_C , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_CT1 , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_CT0 , GrB_TRAN , GrB_INP0_FIELD) ; + DGET (GrB_DESC_CT0T1 , GrB_TRAN , GrB_INP0_FIELD) ; + + DGET (GrB_DESC_S , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_ST1 , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_ST0 , GrB_TRAN , GrB_INP0_FIELD) ; + DGET (GrB_DESC_ST0T1 , GrB_TRAN , GrB_INP0_FIELD) ; + + DGET (GrB_DESC_SC , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_SCT1 , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_SCT0 , GrB_TRAN , GrB_INP0_FIELD) ; + DGET (GrB_DESC_SCT0T1 , GrB_TRAN , GrB_INP0_FIELD) ; + + DGET (GrB_DESC_R , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_RT1 , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_RT0 , GrB_TRAN , GrB_INP0_FIELD) ; + DGET (GrB_DESC_RT0T1 , GrB_TRAN , GrB_INP0_FIELD) ; + + DGET (GrB_DESC_RC , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_RCT1 , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_RCT0 , GrB_TRAN , GrB_INP0_FIELD) ; + DGET (GrB_DESC_RCT0T1 , GrB_TRAN , GrB_INP0_FIELD) ; + + DGET (GrB_DESC_RS , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_RST1 , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_RST0 , GrB_TRAN , GrB_INP0_FIELD) ; + DGET (GrB_DESC_RST0T1 , GrB_TRAN , GrB_INP0_FIELD) ; + + DGET (GrB_DESC_RSC , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_RSCT1 , GrB_DEFAULT, GrB_INP0_FIELD) ; + DGET (GrB_DESC_RSCT0 , GrB_TRAN , GrB_INP0_FIELD) ; + DGET (GrB_DESC_RSCT0T1 , GrB_TRAN , GrB_INP0_FIELD) ; + + + DGET (GrB_NULL , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_T1 , GrB_TRAN , GrB_INP1_FIELD) ; + DGET (GrB_DESC_T0 , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_T0T1 , GrB_TRAN , GrB_INP1_FIELD) ; + + DGET (GrB_DESC_C , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_CT1 , GrB_TRAN , GrB_INP1_FIELD) ; + DGET (GrB_DESC_CT0 , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_CT0T1 , GrB_TRAN , GrB_INP1_FIELD) ; + + DGET (GrB_DESC_S , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_ST1 , GrB_TRAN , GrB_INP1_FIELD) ; + DGET (GrB_DESC_ST0 , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_ST0T1 , GrB_TRAN , GrB_INP1_FIELD) ; + + DGET (GrB_DESC_SC , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_SCT1 , GrB_TRAN , GrB_INP1_FIELD) ; + DGET (GrB_DESC_SCT0 , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_SCT0T1 , GrB_TRAN , GrB_INP1_FIELD) ; + + DGET (GrB_DESC_R , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_RT1 , GrB_TRAN , GrB_INP1_FIELD) ; + DGET (GrB_DESC_RT0 , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_RT0T1 , GrB_TRAN , GrB_INP1_FIELD) ; + + DGET (GrB_DESC_RC , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_RCT1 , GrB_TRAN , GrB_INP1_FIELD) ; + DGET (GrB_DESC_RCT0 , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_RCT0T1 , GrB_TRAN , GrB_INP1_FIELD) ; + + DGET (GrB_DESC_RS , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_RST1 , GrB_TRAN , GrB_INP1_FIELD) ; + DGET (GrB_DESC_RST0 , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_RST0T1 , GrB_TRAN , GrB_INP1_FIELD) ; + + DGET (GrB_DESC_RSC , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_RSCT1 , GrB_TRAN , GrB_INP1_FIELD) ; + DGET (GrB_DESC_RSCT0 , GrB_DEFAULT, GrB_INP1_FIELD) ; + DGET (GrB_DESC_RSCT0T1 , GrB_TRAN , GrB_INP1_FIELD) ; + + + for (int field = GxB_AxB_METHOD ; field <= GxB_IMPORT ; field++) + { + DGET (GrB_NULL , GrB_DEFAULT, field) ; + DGET (GrB_DESC_T1 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_T0 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_T0T1 , GrB_DEFAULT, field) ; + + DGET (GrB_DESC_C , GrB_DEFAULT, field) ; + DGET (GrB_DESC_CT1 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_CT0 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_CT0T1 , GrB_DEFAULT, field) ; + + DGET (GrB_DESC_S , GrB_DEFAULT, field) ; + DGET (GrB_DESC_ST1 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_ST0 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_ST0T1 , GrB_DEFAULT, field) ; + + DGET (GrB_DESC_SC , GrB_DEFAULT, field) ; + DGET (GrB_DESC_SCT1 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_SCT0 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_SCT0T1 , GrB_DEFAULT, field) ; + + DGET (GrB_DESC_R , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RT1 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RT0 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RT0T1 , GrB_DEFAULT, field) ; + + DGET (GrB_DESC_RC , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RCT1 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RCT0 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RCT0T1 , GrB_DEFAULT, field) ; + + DGET (GrB_DESC_RS , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RST1 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RST0 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RST0T1 , GrB_DEFAULT, field) ; + + DGET (GrB_DESC_RSC , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RSCT1 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RSCT0 , GrB_DEFAULT, field) ; + DGET (GrB_DESC_RSCT0T1 , GrB_DEFAULT, field) ; + } + + OK (GrB_Descriptor_get_String (NULL, name, GrB_NAME)) ; + CHECK (MATCH (name, "GrB_NULL")) ; + + //-------------------------------------------------------------------------- + + OK (GrB_Descriptor_new (&desc)) ; + + DSET (desc, GrB_REPLACE, GrB_OUTP_FIELD) ; + DSET (desc, GrB_DEFAULT, GrB_OUTP_FIELD) ; + + DSET (desc, GrB_REPLACE, GrB_OUTP) ; + DSET (desc, GrB_DEFAULT, GrB_OUTP) ; + + DSET (desc, GrB_COMP , GrB_MASK_FIELD) ; + DSET (desc, GrB_STRUCTURE , GrB_MASK_FIELD) ; + DSET (desc, GrB_COMP_STRUCTURE , GrB_MASK_FIELD) ; + DSET (desc, GrB_DEFAULT , GrB_MASK_FIELD) ; + + DSET (desc, GrB_COMP , GrB_MASK) ; + DSET (desc, GrB_STRUCTURE , GrB_MASK) ; + DSET (desc, GrB_COMP_STRUCTURE , GrB_MASK) ; + DSET (desc, GrB_DEFAULT , GrB_MASK) ; + + DSET (desc, GrB_TRAN , GrB_INP0) ; + DSET (desc, GrB_DEFAULT , GrB_INP0) ; + + DSET (desc, GrB_TRAN , GrB_INP1) ; + DSET (desc, GrB_DEFAULT , GrB_INP1) ; + + DSET (desc, GxB_AxB_GUSTAVSON , GxB_AxB_METHOD) ; + DSET (desc, GxB_AxB_DOT , GxB_AxB_METHOD) ; + DSET (desc, GxB_AxB_HASH , GxB_AxB_METHOD) ; + DSET (desc, GxB_AxB_SAXPY , GxB_AxB_METHOD) ; + DSET (desc, GrB_DEFAULT , GxB_AxB_METHOD) ; + + DSET (desc, 1 , GxB_SORT) ; + DSET (desc, GrB_DEFAULT , GxB_SORT) ; + + DSET (desc, 1 , GxB_COMPRESSION) ; + DSET (desc, GrB_DEFAULT , GxB_COMPRESSION) ; + + DSET (desc, GxB_FAST_IMPORT , GxB_IMPORT) ; + DSET (desc, GxB_SECURE_IMPORT , GxB_IMPORT) ; + DSET (desc, GrB_DEFAULT , GxB_IMPORT) ; + + OK (GrB_Descriptor_get_String_ (desc, name, GrB_NAME)) ; + CHECK (MATCH (name, "")) ; + OK (GrB_Descriptor_set_String_ (desc, "user_name", GrB_NAME)) ; + OK (GrB_Descriptor_get_String_ (desc, name, GrB_NAME)) ; + printf ("got name: [%s]\n", name) ; + CHECK (MATCH (name, "user_name")) ; + OK (GrB_Descriptor_set_String_ (desc, "", GrB_NAME)) ; + OK (GrB_Descriptor_get_String_ (desc, name, GrB_NAME)) ; + printf ("got name: [%s]\n", name) ; + CHECK (MATCH (name, "")) ; + METHOD (GrB_Descriptor_set_String_ (desc, "yet another name", GrB_NAME)) ; + OK (GrB_Descriptor_get_String_ (desc, name, GrB_NAME)) ; + printf ("got name: [%s]\n", name) ; + CHECK (MATCH (name, "yet another name")) ; + OK (GrB_Descriptor_get_SIZE_ (desc, &size, GrB_NAME)) ; + CHECK (size == strlen (name) + 1) ; + + //-------------------------------------------------------------------------- + // error handling + //-------------------------------------------------------------------------- + + printf ("\nerror handling:\n") ; + expected = GrB_INVALID_VALUE ; + ERR (GrB_Descriptor_get_VOID_ (GrB_DESC_T1, nothing, GrB_NAME)) ; + ERR (GrB_Descriptor_set_VOID_ (desc, nothing, 0, 0)) ; + + 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_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)) ; + + char *err ; + 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, 995, GxB_AxB_METHOD)) ; + 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_MASK)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Descriptor_set_VOID_ (desc, nothing, 0, 0)) ; + ERR (GrB_Descriptor_get_VOID_ (desc, nothing, 0)) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&A) ; + GrB_free (&v) ; + GrB_free (&s) ; + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GrB_free (&desc) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test34: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test35.c b/GraphBLAS/Test/GB_mex_test35.c new file mode 100644 index 0000000000..76ede3b340 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test35.c @@ -0,0 +1,316 @@ +//------------------------------------------------------------------------------ +// GB_mex_test35: test GrB_get for a serialized blob +//------------------------------------------------------------------------------ + +// 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" + +#define USAGE "GB_mex_test35" + +#define FREE_ALL ; +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +typedef struct { int32_t stuff ; } mytype ; +#define MYTYPE_DEFN \ +"typedef struct { int32_t stuff ; } mytype ;" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info, expected ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix A = NULL ; + GrB_Scalar s = NULL, s_fp64 = NULL, s_int32 = NULL, s_fp32 = NULL ; + GrB_Type type = NULL ; + uint8_t stuff [256] ; + void *nothing = stuff ; + size_t size, blob_size = 0 ; + char name [256] ; + char defn [2048] ; + int32_t code, i ; + float fvalue ; + double dvalue ; + void *blob = NULL ; + + OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; + OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; + OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; + + //-------------------------------------------------------------------------- + // GxB_Serialized_get + //-------------------------------------------------------------------------- + + OK (GrB_Matrix_new (&A, GrB_FP32, 5, 5)) ; + OK (GrB_Matrix_setElement (A, 0, 0, 1)) ; + OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; + OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; + + 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")) ; + + 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) ; + + 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, GxB_SPARSITY_CONTROL, blob_size)) ; + printf ("blob sparsity control: %d\n", i) ; + CHECK (i == GxB_AUTO_SPARSITY) ; + + OK (GrB_assign (A, NULL, NULL, 1, GrB_ALL, 5, GrB_ALL, 5, NULL)) ; + OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; + + OK (GrB_Matrix_get_String_ (A, name, GxB_JIT_C_NAME)) ; + CHECK (MATCH (name, "float")) ; + + OK (GrB_Matrix_get_SIZE_(A, &size, GrB_NAME)) ; + CHECK (size == 1) ; + OK (GrB_Matrix_get_String_(A, name, GrB_NAME)) ; + CHECK (MATCH (name, "")) ; + + OK (GrB_Matrix_set_String_(A, "A matrix", GrB_NAME)) ; + 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 ; + OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; + + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_SPARSITY_STATUS, blob_size)) ; + printf ("blob sparsity status: %d\n", i) ; + CHECK (i == GxB_FULL) ; + + OK (GxB_Serialized_get_String_ (blob, name, GrB_NAME, blob_size)) ; + printf ("name: [%s]\n", name) ; + CHECK (MATCH (name, "A matrix")) ; + OK (GxB_Serialized_get_String_ (blob, &size, GrB_NAME, blob_size)) ; + CHECK (size == strlen ("A matrix") + 1) ; + + OK (GxB_Serialized_get_String_ (blob, name, GrB_EL_TYPE_STRING, blob_size)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + OK (GxB_Serialized_get_String_(blob, &size, GrB_EL_TYPE_STRING, blob_size)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + + OK (GxB_Serialized_get_String_ (blob, name, GxB_JIT_C_NAME, blob_size)) ; + CHECK (MATCH (name, "float")) ; + OK (GxB_Serialized_get_String_ (blob, &size, GxB_JIT_C_NAME, blob_size)) ; + CHECK (size == strlen ("float") + 1) ; + + expected = GrB_INVALID_VALUE ; + ERR (GxB_Serialized_get_INT32_(blob, &i, 0, blob_size)) ; + ERR (GxB_Serialized_get_SIZE_(blob, &size, 0, blob_size)) ; + + fvalue = -1 ; + 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 (abs (fvalue - 0.04) < 1e-6) ; + + OK (GrB_Matrix_set_INT32_(A, GxB_BITMAP, GxB_SPARSITY_CONTROL)) ; + + // 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_String_(A, name, GxB_JIT_C_NAME)) ; + + 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, 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, GxB_HYPER_SWITCH, blob_size)) ; + OK (GrB_Scalar_extractElement_FP64_(&dvalue, s_fp64)) ; + printf ("blob hyper switch: %g\n", dvalue) ; + CHECK (abs (dvalue - 0.25) < 1e-6) ; + + 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, 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)) ; + + OK (GxB_Serialized_get_INT32_(blob, &i, GrB_STORAGE_ORIENTATION_HINT, + blob_size)) ; + CHECK (i == GrB_ROWMAJOR) ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_FORMAT, blob_size)) ; + CHECK (i == GxB_BY_ROW) ; + // GxB_print (A, 3) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_Matrix_get_String_(A, defn, 999)) ; + ERR (GrB_Matrix_get_Scalar(A, s_int32, 999)) ; + + OK (GrB_Matrix_get_SIZE_(A, &size, GrB_NAME)) ; + CHECK (size == strlen ("A matrix") + 1) ; + + expected = GrB_INVALID_OBJECT ; + uint8_t *b = (uint8_t *) blob ; + ERR (GxB_Serialized_get_INT32_(blob, &i, GxB_FORMAT, 20)) ; + b [0]++ ; + ERR (GxB_Serialized_get_INT32_(blob, &i, GxB_FORMAT, blob_size)) ; + b [0]-- ; + 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, + blob_size)) ; + OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; + CHECK (i == GrB_ROWMAJOR) ; + + 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, 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, GxB_SPARSITY_STATUS, + blob_size)) ; + OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; + CHECK (i == GxB_BITMAP) ; + + expected = GrB_INVALID_VALUE ; + ERR (GxB_Serialized_get_Scalar_(blob, s_int32, GrB_NAME, blob_size)) ; + ERR (GxB_Serialized_get_Scalar_(blob, name, 9999, blob_size)) ; + + OK (GrB_Type_new (&type, sizeof (mytype))) ; + OK (GrB_Type_set_String_ (type, "mytype", GxB_JIT_C_NAME)) ; + OK (GrB_Type_set_String_ (type, MYTYPE_DEFN, GxB_JIT_C_DEFINITION)) ; + GrB_free (&A) ; + + int32_t one = 1 ; + OK (GrB_Matrix_new (&A, type, 5, 5)) ; + OK (GrB_Matrix_setElement (A, (void *) &one, 0, 0)) ; + OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; + OK (GxB_print (A, 3)) ; + OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; + + // 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_String_(blob, name, GrB_NAME, blob_size)) ; + CHECK (MATCH (name, "")) ; + + OK (GxB_Serialized_get_String_(blob, name, GxB_JIT_C_NAME, blob_size)) ; + CHECK (MATCH (name, "mytype")) ; + + OK (GxB_Serialized_get_String_(blob, name, GrB_EL_TYPE_STRING, blob_size)) ; + CHECK (MATCH (name, "")) ; + + GrB_free (&A) ; + GrB_free (&type) ; + OK (GrB_Type_new (&type, sizeof (mytype))) ; + 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, GxB_SPARSITY_CONTROL)) ; + + OK (GrB_Matrix_set_String_(A, "A hyper", GrB_NAME)) ; + OK (GrB_Matrix_get_String_(A, name, GrB_NAME)) ; + printf ("name [%s]\n", name) ; + CHECK (MATCH (name, "A hyper")) ; + 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)) ; + + OK (GxB_Serialized_get_String_(blob, name, GxB_JIT_C_NAME, blob_size)) ; + CHECK (MATCH (name, "")) ; + OK (GxB_Serialized_get_String_(blob, name, GrB_NAME, blob_size)) ; + printf ("name [%s]\n", name) ; + CHECK (MATCH (name, "A hyper")) ; + + OK (GrB_Type_set_String_ (type, "mytype", GxB_JIT_C_NAME)) ; + OK (GrB_Type_set_String_ (type, "my type", GrB_NAME)) ; + + // 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_String_(blob, name, GxB_JIT_C_NAME, blob_size)) ; + CHECK (MATCH (name, "mytype")) ; + OK (GxB_Serialized_get_String_(blob, name, GrB_EL_TYPE_STRING, blob_size)) ; + CHECK (MATCH (name, "my type")) ; + OK (GxB_Serialized_get_String_(blob, name, GrB_NAME, blob_size)) ; + printf ("name [%s]\n", name) ; + CHECK (MATCH (name, "A hyper")) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + GrB_free (&A) ; + GrB_free (&s) ; + GrB_free (&s_fp64) ; + GrB_free (&s_fp32) ; + GrB_free (&s_int32) ; + GrB_free (&type) ; + if (blob != NULL) mxFree (blob) ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test35: all tests passed.\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test5.c b/GraphBLAS/Test/GB_mex_test5.c index a794b031ce..7d48a17de0 100644 --- a/GraphBLAS/Test/GB_mex_test5.c +++ b/GraphBLAS/Test/GB_mex_test5.c @@ -547,20 +547,12 @@ void mexFunction OK (GrB_IndexUnaryOp_wait_ (Banded, GrB_MATERIALIZE)) ; OK (GxB_IndexUnaryOp_fprint (Banded, "banded", 3, NULL)) ; -// #undef GrB_IndexUnaryOp_new -// #undef GrM_IndexUnaryOp_new -// OK (GRB (IndexUnaryOp_new) (&UpperBanded, -// (GxB_index_unary_function) upperbanded_idx, -// GrB_BOOL, GrB_INT64, GrB_INT64)) ; OK (GxB_IndexUnaryOp_new (&UpperBanded, (GxB_index_unary_function) upperbanded_idx, GrB_BOOL, GrB_INT64, GrB_INT64, "upperbanded_idx", UPPERBANDED_IDX_DEFN)) ; OK (GxB_IndexUnaryOp_fprint (UpperBanded, "upperbanded", 3, NULL)) ; -// OK (GRB (IndexUnaryOp_new) (&UpperBanded_int64, -// (GxB_index_unary_function) upperbanded_idx_int64, -// GrB_INT64, GrB_INT64, GrB_INT64)) ; OK (GxB_IndexUnaryOp_new (&UpperBanded_int64, (GxB_index_unary_function) upperbanded_idx_int64, GrB_INT64, GrB_INT64, GrB_INT64, @@ -1240,7 +1232,7 @@ void mexFunction expected = GrB_DOMAIN_MISMATCH ; printf ("(1)------------------------------------------------\n") ; - OK (GRB (IndexUnaryOp_new) (&Gunk, + OK (GrB_IndexUnaryOp_new (&Gunk, (GxB_index_unary_function) donothing, MyType, MyType, MyType)) ; ERR (GrB_Matrix_select_Scalar (A, NULL, NULL, Gunk, A, scalar, NULL)) ; OK (GrB_Matrix_error_ (&err, A)) ; @@ -1248,7 +1240,7 @@ void mexFunction OK (GrB_IndexUnaryOp_free_ (&Gunk)) ; printf ("(2)------------------------------------------------\n") ; - OK (GRB (IndexUnaryOp_new) (&Gunk, + OK (GrB_IndexUnaryOp_new (&Gunk, (GxB_index_unary_function) donothing, GrB_BOOL, MyType, MyType)) ; ERR (GrB_Matrix_select_Scalar (A, NULL, NULL, Gunk, A, scalar, NULL)) ; OK (GrB_Matrix_error_ (&err, A)) ; @@ -1256,7 +1248,7 @@ void mexFunction OK (GrB_IndexUnaryOp_free_ (&Gunk)) ; printf ("(3)------------------------------------------------\n") ; - OK (GRB (IndexUnaryOp_new) (&Gunk, + OK (GrB_IndexUnaryOp_new (&Gunk, (GxB_index_unary_function) donothing, GrB_BOOL, GrB_FP64, MyType)) ; ERR (GrB_Matrix_select_Scalar (A, NULL, NULL, Gunk, A, scalar, NULL)) ; OK (GrB_Matrix_error_ (&err, A)) ; @@ -1264,7 +1256,7 @@ void mexFunction OK (GrB_IndexUnaryOp_free_ (&Gunk)) ; printf ("(4)------------------------------------------------\n") ; - OK (GRB (IndexUnaryOp_new) (&Gunk, + OK (GrB_IndexUnaryOp_new (&Gunk, (GxB_index_unary_function) donothing, MyType, GrB_FP64, GrB_FP64)) ; ERR (GrB_Matrix_select_Scalar (A, NULL, NULL, Gunk, A, scalar, NULL)) ; OK (GrB_Matrix_error_ (&err, A)) ; diff --git a/GraphBLAS/Test/GB_mex_test7.c b/GraphBLAS/Test/GB_mex_test7.c index c9340ffe46..cffd16f7aa 100644 --- a/GraphBLAS/Test/GB_mex_test7.c +++ b/GraphBLAS/Test/GB_mex_test7.c @@ -29,6 +29,7 @@ void mexFunction GrB_Info info ; GrB_Matrix A = NULL, B = NULL, Y_mangled = NULL, Y = NULL, C1 = NULL, C2 = NULL ; + GrB_Scalar s = NULL ; //-------------------------------------------------------------------------- // startup GraphBLAS @@ -41,6 +42,15 @@ void mexFunction // matrix check //-------------------------------------------------------------------------- + OK (GrB_Scalar_new (&s, GrB_INT64)) ; + OK (GrB_Scalar_setElement_INT64 (s, 0)) ; + OK (GrB_Global_set_Scalar (GrB_GLOBAL, s, GxB_HYPER_HASH)) ; + OK (GrB_Scalar_clear (s)) ; + 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, GxB_HYPERSPARSE)) ; OK (GrB_Matrix_setElement_FP64 (A, (double) 1.2, 0, 0)) ; @@ -286,6 +296,13 @@ void mexFunction // wrapup //-------------------------------------------------------------------------- + OK (GrB_Scalar_setElement_INT64 (s, 1024)) ; + OK (GrB_Global_set_Scalar (GrB_GLOBAL, s, GxB_HYPER_HASH)) ; + OK (GrB_Scalar_clear (s)) ; + 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)) ; GB_mx_put_global (true) ; printf ("\nGB_mex_test7: all tests passed\n\n") ; } diff --git a/GraphBLAS/Test/GB_mx_get_global.c b/GraphBLAS/Test/GB_mx_get_global.c index 374bab5a97..2293698d51 100644 --- a/GraphBLAS/Test/GB_mx_get_global.c +++ b/GraphBLAS/Test/GB_mx_get_global.c @@ -162,6 +162,16 @@ bool GB_mx_get_global // true if doing malloc_debug Complex_init (builtin_complex [0]) ; + //-------------------------------------------------------------------------- + // set the hyper_hash control to a small value + //-------------------------------------------------------------------------- + + GrB_Scalar s ; + GrB_Scalar_new (&s, GrB_INT64) ; + GrB_Scalar_setElement_INT64 (s, 8) ; + GrB_Global_set_Scalar (GrB_GLOBAL, s, GxB_HYPER_HASH) ; + GrB_Scalar_free (&s) ; + //-------------------------------------------------------------------------- // return malloc debug status //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_op.m b/GraphBLAS/Test/GB_spec_op.m index 8e31058d65..52b3f07dc3 100644 --- a/GraphBLAS/Test/GB_spec_op.m +++ b/GraphBLAS/Test/GB_spec_op.m @@ -222,20 +222,20 @@ z = pow2 (x,y) ; case { 'fmod', 'rem' } - % see ANSI C11 fmod function - % the built-in rem differs slightly from the ANSI C11 fmod, + % see C11 fmod function + % the built-in rem differs slightly from the C11 fmod, % if x/y is O(eps) smaller than an integer. z = rem (x,y) ; case { 'remainder' } - % see ANSI C11 remainder function + % see C11 remainder function m = (y ~= 0 & x ~= y) ; z = nan (size (x), ztype) ; z (x == y) = 0 ; z (m) = x (m) - round (x (m) ./ y (m)) .* y (m) ; case { 'copysign' } - % see ANSI C11 copysign function + % see C11 copysign function z = abs (x) .* (2 * double (y >= 0) - 1) ; case { 'complex', 'cmplx' } diff --git a/GraphBLAS/Test/README.txt b/GraphBLAS/Test/README.txt index e633aa6fdb..9fa56d5242 100644 --- a/GraphBLAS/Test/README.txt +++ b/GraphBLAS/Test/README.txt @@ -15,8 +15,8 @@ files to provide 'help GB_mex...' documentation. For a usable @GrB interface to GraphBLAS, see the GraphBLAS/GraphBLAS folder, and the @GrB object it supports. -Requirements: the mex command must use a C compiler supporting ANSI C11. -Microft Visual Studio does not support ANSI C11 so this test is not available +Requirements: the mex command must use a C compiler supporting C11. +Microft Visual Studio does not support C11 so this test is not available on Windows unless you use another compiler. To run the tests, use the following command in this directory, in the diff --git a/GraphBLAS/Test/logstat.m b/GraphBLAS/Test/logstat.m index 73c0b1043f..111e7898e5 100644 --- a/GraphBLAS/Test/logstat.m +++ b/GraphBLAS/Test/logstat.m @@ -142,8 +142,13 @@ function logstat (testscript, threads, jit_controls, factory_controls) fprintf (f, '%s %-11s %7.1f sec ', s, testscript, t) ; if (~isempty (strfind (pwd, 'Tcov'))) - global GraphBLAS_debug GraphBLAS_grbcov - save grbstat GraphBLAS_debug GraphBLAS_grbcov testscript + global GraphBLAS_debug GraphBLAS_grbcov GraphBLAS_grbcovs ... + GraphBLAS_scripts GraphBLAS_times + GraphBLAS_grbcovs {end+1} = GraphBLAS_grbcov (1:n) ; + GraphBLAS_scripts {end+1} = testscript ; + GraphBLAS_times {end+1} = t ; + save grbstat GraphBLAS_debug GraphBLAS_grbcov GraphBLAS_grbcovs ... + GraphBLAS_scripts GraphBLAS_times if (isempty (GraphBLAS_debug)) GraphBLAS_debug = false ; end diff --git a/GraphBLAS/Test/make.m b/GraphBLAS/Test/make.m index 63e4af6d52..99e1750314 100644 --- a/GraphBLAS/Test/make.m +++ b/GraphBLAS/Test/make.m @@ -11,7 +11,7 @@ function make (what) % % in -lgraphblas, use 'make all' if recompilation is needed % make all % make everything from scratch % -% GraphBLAS requires an ANSI C11 compliant compiler. On the Mac, clang 8.0 +% GraphBLAS requires an C11 compliant compiler. On the Mac, clang 8.0 % suffices. gcc should be version 4.9.3 or later % SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. diff --git a/GraphBLAS/Test/test269.m b/GraphBLAS/Test/test269.m new file mode 100644 index 0000000000..7499482c72 --- /dev/null +++ b/GraphBLAS/Test/test269.m @@ -0,0 +1,10 @@ +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. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test26 ; +fprintf ('test269: all tests passed.\n') ; + + diff --git a/GraphBLAS/Test/test270.m b/GraphBLAS/Test/test270.m new file mode 100644 index 0000000000..ef47b3e291 --- /dev/null +++ b/GraphBLAS/Test/test270.m @@ -0,0 +1,10 @@ +function test270 +%TEST270 test GrB_get / GrB_set for unary ops + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test27 ; +fprintf ('test270: all tests passed.\n') ; + + diff --git a/GraphBLAS/Test/test271.m b/GraphBLAS/Test/test271.m new file mode 100644 index 0000000000..d894881954 --- /dev/null +++ b/GraphBLAS/Test/test271.m @@ -0,0 +1,10 @@ +function test271 +%TEST271 test GrB_get / GrB_set for binary ops + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test28 ; +fprintf ('test271: all tests passed.\n') ; + + diff --git a/GraphBLAS/Test/test273.m b/GraphBLAS/Test/test273.m new file mode 100644 index 0000000000..d6ab27b54d --- /dev/null +++ b/GraphBLAS/Test/test273.m @@ -0,0 +1,9 @@ +function test273 +%TEST273 test Global get/set + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test29 ; +fprintf ('test273 all tests passed.\n') ; + diff --git a/GraphBLAS/Test/test274.m b/GraphBLAS/Test/test274.m new file mode 100644 index 0000000000..0e6ea92271 --- /dev/null +++ b/GraphBLAS/Test/test274.m @@ -0,0 +1,9 @@ +function test274 +%TEST274 test get/set for IndexUnary ops + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test30 ; +fprintf ('test274 all tests passed.\n') ; + diff --git a/GraphBLAS/Test/test275.m b/GraphBLAS/Test/test275.m new file mode 100644 index 0000000000..b6238edafb --- /dev/null +++ b/GraphBLAS/Test/test275.m @@ -0,0 +1,9 @@ +function test275 +%TEST275 test get/set for monoids + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test31 ; +fprintf ('test275 all tests passed.\n') ; + diff --git a/GraphBLAS/Test/test276.m b/GraphBLAS/Test/test276.m new file mode 100644 index 0000000000..832a5c1794 --- /dev/null +++ b/GraphBLAS/Test/test276.m @@ -0,0 +1,9 @@ +function test276 +%TEST276 test get/set for semirings + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test32 ; +fprintf ('test276 all tests passed.\n') ; + diff --git a/GraphBLAS/Test/test277.m b/GraphBLAS/Test/test277.m new file mode 100644 index 0000000000..c84d58d820 --- /dev/null +++ b/GraphBLAS/Test/test277.m @@ -0,0 +1,9 @@ +function test277 +%TEST277 test get/set for context + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test33 ; +fprintf ('test277 all tests passed.\n') ; + diff --git a/GraphBLAS/Test/test278.m b/GraphBLAS/Test/test278.m new file mode 100644 index 0000000000..b594294c13 --- /dev/null +++ b/GraphBLAS/Test/test278.m @@ -0,0 +1,9 @@ +function test278 +%TEST278 test get/set for descriptor + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test34 ; +fprintf ('test278 all tests passed.\n') ; + diff --git a/GraphBLAS/Test/test279.m b/GraphBLAS/Test/test279.m new file mode 100644 index 0000000000..cb5a68c705 --- /dev/null +++ b/GraphBLAS/Test/test279.m @@ -0,0 +1,9 @@ +function test279 +%TEST279 test get/set for serialized blob + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test35 ; +fprintf ('test279 all tests passed.\n') ; + diff --git a/GraphBLAS/Test/testall.m b/GraphBLAS/Test/testall.m index db7e9fe704..17204c2a56 100644 --- a/GraphBLAS/Test/testall.m +++ b/GraphBLAS/Test/testall.m @@ -74,12 +74,15 @@ function testall (threads,longtests) f00 = {0,0} ; % factory off, off % run twice +j04 = {0,4} ; % JIT off, off j40 = {4,0} ; % JIT on, off f11 = {1,1} ; % factory on, on j4040 = {4,0,4,0} ; % JIT on, off, on , off f1100 = {1,1,0,0} ; % factory on, on , off, off +j040 = {0,4,0} ; % JIT off, on , off + j440 = {4,4,0} ; % JIT on, on , off f100 = {1,0,0} ; % factory on, off, off @@ -96,7 +99,18 @@ function testall (threads,longtests) % tests with high rates (over 100/sec) %---------------------------------------- -logstat ('test272' ,t, j0 , f1 ) ; % Context +logstat ('test250' ,t, j44 , f10 ) ; % JIT tests, set/get, other 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 ('test276' ,t, j0 , f1 ) ; % semiring get/set +logstat ('test275' ,t, j0 , f1 ) ; % monoid get/set +logstat ('test274' ,t, j0 , f1 ) ; % index unary op get/set +logstat ('test273' ,t, j0 , f1 ) ; % global get/set +logstat ('test272' ,t, j0 , f1 ) ; % misc simple tests +logstat ('test271' ,t, j0 , f1 ) ; % binary op get/set +logstat ('test270' ,t, j0 , f1 ) ; % unary op get/set +logstat ('test269' ,t, j0 , f1 ) ; % get/set for type, scalar, vec, mtx logstat ('test268' ,t, j4 , f1 ) ; % C=Z sparse masker jall = {4,3,2,1,4,2} ; fall = {1,1,1,1,0,0} ; @@ -112,7 +126,6 @@ function testall (threads,longtests) hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack logstat ('test267' ,t, j40 , f00 ) ; % JIT error handling -logstat ('test266' ,t, j4 , f0 ) ; % JIT error handling logstat ('test265' ,t, j4 , f0 ) ; % reduce to scalar with user types logstat ('test264' ,t, j4 , f0 ) ; % enumify / macrofy tests logstat ('test263' ,t, j4 , f0 ) ; % JIT tests @@ -126,13 +139,14 @@ function testall (threads,longtests) logstat ('test254' ,t, j440, f100) ; %% mask types logstat ('test253' ,t, j4 , f1 ) ; % basic JIT tests logstat ('test252' ,t, j4 , f1 ) ; % basic tests -logstat ('test251' ,t, j404, f110) ; % dot4, dot2, with plus_pair -logstat ('test250' ,t, j44 , f10 ) ; % JIT tests, set/get, other tests +%ogstat ('test251' ,t, j404, f110) ; % dot4, dot2, with plus_pair +logstat ('test251' ,t, j44 , f10 ) ; % dot4, dot2, with plus_pair logstat ('test249' ,t, j4 , f1 ) ; % GxB_Context object logstat ('test247' ,t, j4 , f1 ) ; % GrB_mxm: fine Hash method logstat ('test246' ,t, j4 , f1 ) ; % GrB_mxm parallelism (slice_balanced) -logstat ('test01' ,t, j44 , f10 ) ; % error handling +%ogstat ('test01' ,t, j44 , f10 ) ; % error handling +logstat ('test01' ,t, j4 , f1 ) ; % error handling logstat ('test245' ,t, j40 , f11 ) ; % test complex row/col scale logstat ('test199' ,t, j4 , f1 ) ; % test dot2 with hypersparse logstat ('test83' ,t, j4 , f1 ) ; % GrB_assign with C_replace and empty J @@ -151,7 +165,8 @@ function testall (threads,longtests) logstat ('test256' ,t, j4 , f0 ) ; % JIT error handling logstat ('test186' ,t, j40 , f11 ) ; % saxpy, all formats (slice_balanced) logstat ('test186(0)' ,t, j4 , f1 ) ; % repeat with default slice_balanced -logstat ('test150' ,t, j40 , f10 ) ; %% mxm zombies, typecasting (dot3,saxpy) +%ogstat ('test150' ,t, j40 , f10 ) ; %% mxm zombies, typecasting (dot3,saxpy) +logstat ('test150' ,t, j0 , f0 ) ; %% mxm zombies, typecasting (dot3,saxpy) hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack @@ -165,7 +180,7 @@ function testall (threads,longtests) logstat ('test179' ,t, j44 , f10 ) ; % test bitmap select logstat ('test174' ,t, j4 , f1 ) ; % test GrB_assign C=A logstat ('test155' ,t, j4 , f1 ) ; % test GrB_*_setElement, removeElement -logstat ('test156' ,t, j44 , f10 ) ; % test GrB_assign C=A with typecasting +%ogstat ('test156' ,t, j44 , f10 ) ; % test GrB_assign C=A with typecasting logstat ('test136' ,s, j4 , f1 ) ; % subassignment special cases logstat ('test02' ,t, j4 , f1 ) ; % matrix copy and dup tests logstat ('test109' ,t, j404, f110) ; % terminal monoid with user-defined type @@ -173,10 +188,12 @@ function testall (threads,longtests) logstat ('test207' ,t, j4 , f1 ) ; % test iso subref logstat ('test221' ,t, j4 , f1 ) ; % test C += A, C is bitmap and A is full logstat ('test162' ,t, j4 , f1 ) ; % test C=A*B with very sparse M -logstat ('test159' ,t, j40 , f10 ) ; %% test A*B +%ogstat ('test159' ,t, j40 , f10 ) ; %% test A*B +logstat ('test159' ,t, j0 , f0 ) ; %% test A*B logstat ('test09' ,t, j4 , f1 ) ; % duplicate I,J test of GB_mex_subassign logstat ('test132' ,t, j4 , f1 ) ; % setElement -logstat ('test141' ,t, j404, f110) ; % eWiseAdd with dense matrices +%ogstat ('test141' ,t, j404, f110) ; % eWiseAdd with dense matrices +logstat ('test141' ,t, j0 , f1 ) ; % eWiseAdd with dense matrices logstat ('testc2(1,1)',t, j44 , f10 ) ; % complex tests (quick case, builtin) logstat ('test214' ,t, j4 , f1 ) ; % test C=A'*B (tricount) logstat ('test213' ,t, j4 , f1 ) ; % test iso assign (method 05d) @@ -198,8 +215,10 @@ function testall (threads,longtests) hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack -logstat ('test14' ,t, j404, f110) ; % GrB_reduce +%ogstat ('test14' ,t, j404, f110) ; % GrB_reduce +logstat ('test14' ,t, j44 , f10 ) ; % GrB_reduce logstat ('test180' ,s, j4 , f1 ) ; % test assign and subassign (1 thread) +%ogstat ('test180' ,t, j4 , f1 ) ; % test assign and subassign (4 threads) logstat ('test236' ,t, j4 , f1 ) ; % test GxB_Matrix_sort, GxB_Vector_sort hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack @@ -219,7 +238,8 @@ function testall (threads,longtests) logstat ('test154' ,t, j40 , f11 ) ; % apply with binop and scalar binding logstat ('test238' ,t, j44 , f10 ) ; % test GrB_mxm (dot4 and dot2) -logstat ('test151b' ,t, j404, f110) ; % test bshift operator +%ogstat ('test151b' ,t, j404, f110) ; % test bshift operator +logstat ('test151b' ,t, j4 , f1 ) ; % test bshift operator logstat ('test184' ,t, j4 , f1 ) ; % special cases: mxm, transpose, build logstat ('test191' ,t, j40 , f10 ) ; %% test split logstat ('test188' ,t, j40 , f11 ) ; % test concat @@ -262,7 +282,8 @@ function testall (threads,longtests) logstat ('test176' ,t, j4 , f1 ) ; % test GrB_assign, method 09, 11 logstat ('test208' ,t, j4 , f1 ) ; % test iso apply, bind 1st and 2nd logstat ('test216' ,t, j4 , f1 ) ; % test C=A, iso case -logstat ('test142' ,t, j4040, f1100) ; %% test GrB_assign with accum +%ogstat ('test142' ,t, j4040, f1100) ; %% test GrB_assign with accum +logstat ('test142' ,t, j040, f100) ; %% test GrB_assign with accum logstat ('test137' ,s, j40 , f11 ) ; % GrB_eWiseMult, FIRST and SECOND logstat ('test139' ,s, j4 , f1 ) ; % merge sort, special cases logstat ('test172' ,t, j4 , f1 ) ; % test eWiseMult with M bitmap/full @@ -296,20 +317,24 @@ function testall (threads,longtests) logstat ('test200' ,t, j4 , f1 ) ; % test iso full matrix multiply logstat ('test197' ,t, j4 , f1 ) ; % test large sparse split logstat ('test84' ,t, j4 , f1 ) ; % GrB_assign (row/col with C CSR/CSC) -logstat ('test19b' ,t, j4 , f1 ) ; % GrB_assign, many pending operators +%ogstat ('test19b' ,t, j4 , f1 ) ; % GrB_assign, many pending operators logstat ('test19b' ,s, j4 , f1 ) ; % GrB_assign, many pending operators logstat ('test133' ,t, j4 , f1 ) ; % test mask operations (GB_masker) logstat ('test80' ,t, j4 , f1 ) ; % test GrB_mxm on all semirings -logstat ('test151' ,t, j44 , f10 ) ; % test bitwise operators -logstat ('test23' ,t, j40 , f11 ) ; % quick test of GB_*_build +%ogstat ('test151' ,t, j44 , f10 ) ; % test bitwise operators +%ogstat ('test23' ,t, j40 , f11 ) ; % quick test of GB_*_build +logstat ('test23' ,t, j0 , f1 ) ; % quick test of GB_*_build logstat ('test135' ,t, j4 , f1 ) ; % reduce to scalar -logstat ('test160' ,s, j40 , f11 ) ; % test A*B, single threaded +%ogstat ('test160' ,s, j40 , f11 ) ; % test A*B, single threaded +logstat ('test160' ,s, j0 , f1 ) ; % test A*B, single threaded logstat ('test54' ,t, j4 , f1 ) ; % assign and extract with begin:inc:end logstat ('test129' ,t, j4 , f1 ) ; % test GxB_select (tril, nonz, hyper) logstat ('test69' ,t, j4 , f1 ) ; % assign and subassign with alias logstat ('test230' ,t, j4 , f1 ) ; % test apply with idxunops -logstat ('test74' ,t, j40 , f11 ) ; % test GrB_mxm on all semirings -logstat ('test127' ,t, j404, f110) ; % test eWiseAdd, eWiseMult +%ogstat ('test74' ,t, j40 , f11 ) ; % test GrB_mxm on all semirings +logstat ('test74' ,t, j0 , f1 ) ; % test GrB_mxm on all semirings +%ogstat ('test127' ,t, j40 , f11 ) ; % test eWiseAdd, eWiseMult +logstat ('test127' ,t, j0 , f1 ) ; % test eWiseAdd, eWiseMult logstat ('test19' ,t, j4 , f1 ) ; % GxB_subassign, many pending operators %---------------------------------------- @@ -319,12 +344,15 @@ function testall (threads,longtests) logstat ('test11' ,t, j4 , f1 ) ; % exhaustive test of GrB_extractTuples logstat ('test215' ,t, j4 , f1 ) ; % test C=A'*B (dot2, ANY_PAIR) logstat ('test193' ,t, j4 , f1 ) ; % test GxB_Matrix_diag +%ogstat ('test195' ,t, j0 , f1 ) ; % all variants of saxpy3 slice_balanced logstat ('test195' ,t, j4 , f1 ) ; % all variants of saxpy3 slice_balanced -% logstat ('test233' ,t, j4 , f1 ) ; % bitmap saxpy C=A*B, A sparse, B bitmap +%ogstat ('test233' ,t, j4 , f1 ) ; % bitmap saxpy C=A*B, A sparse, B bitmap logstat ('test243' ,t, j4 , f1 ) ; % test GxB_Vector_Iterator -logstat ('test29' ,t, j40 , f11 ) ; % reduce with zombies +%ogstat ('test29' ,t, j40 , f11 ) ; % reduce with zombies +logstat ('test29' ,t, j0 , f1 ) ; % reduce with zombies -logstat ('testc2(0,0)',t, j404, f110) ; % A'*B, A+B, A*B, user-defined complex +%ogstat ('testc2(0,0)',t, j404, f110) ; % A'*B, A+B, A*B, user-defined complex +logstat ('testc2(0,0)',t, j04, f10 ) ; % A'*B, A+B, A*B, user-defined complex logstat ('testc4(0)' ,t, j4 , f1 ) ; % extractElement, setElement, user type logstat ('testc7(0)' ,t, j4 , f1 ) ; % assign, builtin complex logstat ('testcc(1)' ,t, j4 , f1 ) ; % transpose, builtin complex @@ -340,6 +368,7 @@ function testall (threads,longtests) logstat ('test53' ,t, j4 , f1 ) ; % quick test of GB_mex_Matrix_extract logstat ('test17' ,t, j4 , f1 ) ; % quick test of GrB_*_extractElement +%ogstat ('test231' ,t, j0 , f1 ) ; % test GrB_select with idxunp logstat ('test231' ,t, j4 , f1 ) ; % test GrB_select with idxunp %---------------------------------------- diff --git a/GraphBLAS/Test/GB_mex_test23.c b/GraphBLAS/Test/unused/GB_mex_test23.c similarity index 100% rename from GraphBLAS/Test/GB_mex_test23.c rename to GraphBLAS/Test/unused/GB_mex_test23.c diff --git a/GraphBLAS/Test/test151.m b/GraphBLAS/Test/unused/test151.m similarity index 100% rename from GraphBLAS/Test/test151.m rename to GraphBLAS/Test/unused/test151.m diff --git a/GraphBLAS/Test/test156.m b/GraphBLAS/Test/unused/test156.m similarity index 100% rename from GraphBLAS/Test/test156.m rename to GraphBLAS/Test/unused/test156.m diff --git a/GraphBLAS/Test/test233.m b/GraphBLAS/Test/unused/test233.m similarity index 100% rename from GraphBLAS/Test/test233.m rename to GraphBLAS/Test/unused/test233.m diff --git a/GraphBLAS/Test/test266.m b/GraphBLAS/Test/unused/test266.m similarity index 100% rename from GraphBLAS/Test/test266.m rename to GraphBLAS/Test/unused/test266.m diff --git a/GraphBLAS/Test/test_assign.m b/GraphBLAS/Test/unused/test_assign.m similarity index 100% rename from GraphBLAS/Test/test_assign.m rename to GraphBLAS/Test/unused/test_assign.m diff --git a/GraphBLAS/cmake_modules/GraphBLAS_JIT_configure.cmake b/GraphBLAS/cmake_modules/GraphBLAS_JIT_configure.cmake index e828f81b32..db377d925e 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-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, 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 2048bcda52..a132e22c2e 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-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, 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 95c6c99f2f..ffc8aa851b 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-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, 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 460472e4f2..af5634683c 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-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/cmake_modules/GraphBLAS_version.cmake b/GraphBLAS/cmake_modules/GraphBLAS_version.cmake index 180c095b58..a5c4512ce8 100644 --- a/GraphBLAS/cmake_modules/GraphBLAS_version.cmake +++ b/GraphBLAS/cmake_modules/GraphBLAS_version.cmake @@ -2,21 +2,21 @@ # GraphBLAS/cmake_modules/GraphBLAS_version.cmake: define the GraphBLAS version #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- # version of SuiteSparse:GraphBLAS -set ( GraphBLAS_DATE "Dec 30, 2023" ) -set ( GraphBLAS_VERSION_MAJOR 8 CACHE STRING "" FORCE ) -set ( GraphBLAS_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( GraphBLAS_VERSION_SUB 1 CACHE STRING "" FORCE ) +set ( GraphBLAS_DATE "Jan 10, 2024" ) +set ( GraphBLAS_VERSION_MAJOR 9 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 "Nov 15, 2021" ) +set ( GraphBLAS_API_DATE "Dec 22, 2023" ) set ( GraphBLAS_API_VERSION_MAJOR 2 ) -set ( GraphBLAS_API_VERSION_MINOR 0 ) +set ( GraphBLAS_API_VERSION_MINOR 1 ) set ( GraphBLAS_API_VERSION_SUB 0 ) message ( STATUS "Building SuiteSparse:GraphBLAS version: v" diff --git a/GraphBLAS/cmake_modules/SuiteSparseAtomic.cmake b/GraphBLAS/cmake_modules/SuiteSparseAtomic.cmake index 9953854836..3b93432294 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-2023, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 2017-2024, 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 f2d132aa74..20a7fcf784 100644 --- a/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake +++ b/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake @@ -247,6 +247,19 @@ message ( STATUS "Build type: ${CMAKE_BUILD_TYPE} ") set ( CMAKE_INCLUDE_CURRENT_DIR ON ) +#------------------------------------------------------------------------------- +# Workaround for math.h on old macOS +#------------------------------------------------------------------------------- + +if ( APPLE AND CMAKE_SYSTEM_VERSION VERSION_LESS 11 ) + # Older versions of math.h on the Mac define Real and Imag, which + # conflict with the internal use of those symbols in CHOLMOD, KLU, SPQR, + # UMFPACK, and ParU. + # This can be disabled with -D__NOEXTENSIONS__ + message ( STATUS "MacOS: disable extensions in math.h" ) + add_compile_definitions ( "__NOEXTENSIONS__" ) +endif ( ) + #------------------------------------------------------------------------------- # check if Fortran is available and enabled #------------------------------------------------------------------------------- diff --git a/GraphBLAS/lz4/README.txt b/GraphBLAS/lz4/README.txt index e2f8c05db7..222c8c9c22 100644 --- a/GraphBLAS/lz4/README.txt +++ b/GraphBLAS/lz4/README.txt @@ -23,7 +23,7 @@ Files in this folder: When LZ4 is compiled for use in SuiteSparse:GraphBLAS, LZ4_USER_MEMORY_FUNCTIONS is defined, and LZ4_malloc, LZ4_calloc, and LZ4_free, are provided to LZ4. Those functions use whatever memory manager is given to -GxB_init, or the ANSI C11 malloc/calloc/free for GrB_init. +GxB_init, or the C11 malloc/calloc/free for GrB_init. This compile-time change could cause a conflict if LZ4 is also installed as a system-wide library. To avoid the conflict, all LZ4 function names are renamed diff --git a/GraphBLAS/zstd/README.txt b/GraphBLAS/zstd/README.txt index 227086b279..6c9d594c89 100644 --- a/GraphBLAS/zstd/README.txt +++ b/GraphBLAS/zstd/README.txt @@ -17,8 +17,8 @@ Files in this folder: When ZSTD is compiled for use in SuiteSparse:GraphBLAS, ZSTD_DEPS_MALLOC is defined, and ZSTD_malloc, ZSTD_calloc, and ZSTD_free, are provided to ZSTD -instead of have it use the standard ANSI C11 malloc/calloc/free. Those -functions use whatever memory manager is given to GxB_init, or the ANSI C11 +instead of have it use the standard C11 malloc/calloc/free. Those +functions use whatever memory manager is given to GxB_init, or the C11 malloc/calloc/free for GrB_init. This compile-time change could cause a conflict if ZSTD is also installed as a diff --git a/KLU/CMakeLists.txt b/KLU/CMakeLists.txt index 5c936c519b..9cc1b20e56 100644 --- a/KLU/CMakeLists.txt +++ b/KLU/CMakeLists.txt @@ -12,10 +12,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( KLU_DATE "Dec 30, 2023" ) +set ( KLU_DATE "Jan 10, 2024" ) set ( KLU_VERSION_MAJOR 2 CACHE STRING "" FORCE ) set ( KLU_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( KLU_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( KLU_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building KLU version: v" ${KLU_VERSION_MAJOR}. @@ -43,22 +43,22 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) - find_package ( AMD 3.3.0 + find_package ( AMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::AMD ) - find_package ( AMD 3.3.0 REQUIRED ) + find_package ( AMD 3.3.1 REQUIRED ) endif ( ) - find_package ( COLAMD 3.3.0 + find_package ( COLAMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::COLAMD ) - find_package ( COLAMD 3.3.0 REQUIRED ) + find_package ( COLAMD 3.3.1 REQUIRED ) endif ( ) find_package ( BTF 2.3.0 @@ -77,10 +77,10 @@ if ( SUITESPARSE_ROOT_CMAKELISTS ) else ( ) if ( KLU_USE_CHOLMOD ) # look for CHOLMOD (optional fill-reducing orderings) - find_package ( CHOLMOD 5.1.0 + find_package ( CHOLMOD 5.1.1 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::CHOLMOD ) - find_package ( CHOLMOD 5.1.0 ) + find_package ( CHOLMOD 5.1.1 ) endif ( ) if ( NOT CHOLMOD_FOUND ) # CHOLMOD not found so disable it @@ -144,7 +144,7 @@ if ( BUILD_SHARED_LIBS ) set_target_properties ( KLU PROPERTIES EXPORT_NO_SYSTEM ON ) endif ( ) - target_include_directories ( KLU + target_include_directories ( KLU INTERFACE $ $ ) endif ( ) @@ -199,7 +199,7 @@ if ( KLU_HAS_CHOLMOD ) set_target_properties ( KLU_CHOLMOD PROPERTIES EXPORT_NO_SYSTEM ON ) endif ( ) - target_include_directories ( KLU_CHOLMOD + target_include_directories ( KLU_CHOLMOD INTERFACE $ $ ) endif ( ) @@ -222,7 +222,7 @@ if ( KLU_HAS_CHOLMOD ) set_target_properties ( KLU_CHOLMOD_static PROPERTIES EXPORT_NO_SYSTEM ON ) endif ( ) - target_include_directories ( KLU_CHOLMOD_static + target_include_directories ( KLU_CHOLMOD_static INTERFACE $ $ ) endif ( ) diff --git a/KLU/Config/KLU.pc.in b/KLU/Config/KLU.pc.in index bdc8503242..df7191b118 100644 --- a/KLU/Config/KLU.pc.in +++ b/KLU/Config/KLU.pc.in @@ -1,4 +1,4 @@ -# KLU, Copyright (c) 2004-2023, Timothy A. Davis. +# KLU, Copyright (c) 2004-2024, Timothy A. Davis. # All Rights Reserved. # SPDX-License-Identifier: LGPL-2.1-or-later diff --git a/KLU/Config/KLUConfig.cmake.in b/KLU/Config/KLUConfig.cmake.in index 9005332dda..f28e22ba73 100644 --- a/KLU/Config/KLUConfig.cmake.in +++ b/KLU/Config/KLUConfig.cmake.in @@ -4,7 +4,7 @@ # The following copyright and license applies to just this file only, not to # the library itself: -# KLUConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# KLUConfig.cmake, Copyright (c) 2023-2024, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- @@ -35,8 +35,6 @@ set ( KLU_VERSION_MINOR @KLU_VERSION_MINOR@ ) set ( KLU_VERSION_PATCH @KLU_VERSION_SUB@ ) set ( KLU_VERSION "@KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@" ) -include ( ${CMAKE_CURRENT_LIST_DIR}/KLUTargets.cmake ) - # Check for dependent targets include ( CMakeFindDependencyMacro ) @@ -103,6 +101,9 @@ if ( NOT SuiteSparse_config_FOUND OR NOT BTF_FOUND OR NOT AMD_FOUND OR NOT COLAM endif ( ) +# Import target +include ( ${CMAKE_CURRENT_LIST_DIR}/KLUTargets.cmake ) + # The following is only for backward compatibility with FindKLU. set ( _target_shared SuiteSparse::KLU ) diff --git a/KLU/Config/KLU_CHOLMOD.pc.in b/KLU/Config/KLU_CHOLMOD.pc.in index 208d452b45..5c5ac12590 100644 --- a/KLU/Config/KLU_CHOLMOD.pc.in +++ b/KLU/Config/KLU_CHOLMOD.pc.in @@ -1,4 +1,4 @@ -# KLU_CHOLMOD, Copyright (c) 2004-2023, Timothy A. Davis. +# KLU_CHOLMOD, Copyright (c) 2004-2024, Timothy A. Davis. # All Rights Reserved. # SPDX-License-Identifier: LGPL-2.1-or-later diff --git a/KLU/Config/KLU_CHOLMODConfig.cmake.in b/KLU/Config/KLU_CHOLMODConfig.cmake.in index 03957ad6ec..2ad6225527 100644 --- a/KLU/Config/KLU_CHOLMODConfig.cmake.in +++ b/KLU/Config/KLU_CHOLMODConfig.cmake.in @@ -4,7 +4,7 @@ # The following copyright and license applies to just this file only, not to # the library itself: -# KLU_CHOLMODConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# KLU_CHOLMODConfig.cmake, Copyright (c) 2023-2024, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- diff --git a/KLU/Config/klu.h.in b/KLU/Config/klu.h.in index fc7e88711f..3e25abdae3 100644 --- a/KLU/Config/klu.h.in +++ b/KLU/Config/klu.h.in @@ -2,7 +2,7 @@ // KLU/Source/klu.h: include file for KLU //------------------------------------------------------------------------------ -// KLU, Copyright (c) 2004-2023, University of Florida. All Rights Reserved. +// KLU, Copyright (c) 2004-2024, University of Florida. All Rights Reserved. // Authors: Timothy A. Davis and Ekanathan Palamadai. // SPDX-License-Identifier: LGPL-2.1+ @@ -829,23 +829,27 @@ void klu_version (int version [3]) ; #define KLU_SUBSUB_VERSION @KLU_VERSION_SUB@ #define KLU_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define KLU_VERSION KLU_VERSION_CODE(KLU_MAIN_VERSION,KLU_SUB_VERSION) +#define KLU_VERSION KLU_VERSION_CODE(@KLU_VERSION_MAJOR@,@KLU_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "KLU @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires SuiteSparse_config 7.4.0 or later" +#define KLU__VERSION SUITESPARSE__VERCODE(@KLU_VERSION_MAJOR@,@KLU_VERSION_MINOR@,@KLU_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "KLU @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif -#if AMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "KLU @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires AMD 3.3.0 or later" +#if !defined (AMD__VERSION) || \ + (AMD__VERSION < SUITESPARSE__VERCODE(3,3,1)) +#error "KLU @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires AMD 3.3.1 or later" #endif -#if COLAMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "KLU @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires COLAMD 3.3.0 or later" +#if !defined (COLAMD__VERSION) || \ + (COLAMD__VERSION < SUITESPARSE__VERCODE(3,3,1)) +#error "KLU @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires COLAMD 3.3.1 or later" #endif -#if BTF_VERSION < SUITESPARSE_VER_CODE(2,3) -#error "KLU @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires BTF 2.3.0 or later" +#if !defined (BTF__VERSION) || \ + (BTF__VERSION < SUITESPARSE__VERCODE(2,3,1)) +#error "KLU @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires BTF 2.3.1 or later" #endif #endif diff --git a/KLU/Doc/ChangeLog b/KLU/Doc/ChangeLog index d2d242795a..ff5fa50952 100644 --- a/KLU/Doc/ChangeLog +++ b/KLU/Doc/ChangeLog @@ -1,3 +1,8 @@ +Jan 10, 2024: version 2.3.1 + + * MATLAB interface: add -DNO_SSIZE_T for Windows + * minor updates to build system + Dec 30, 2023: version 2.3.0 * major change to build system: by Markus Mützel diff --git a/KLU/Doc/KLU_UserGuide.pdf b/KLU/Doc/KLU_UserGuide.pdf index ed61e78a72..acd5ec3a0e 100644 Binary files a/KLU/Doc/KLU_UserGuide.pdf and b/KLU/Doc/KLU_UserGuide.pdf differ diff --git a/KLU/Doc/klu_version.tex b/KLU/Doc/klu_version.tex index 3cec5a71ba..da70ee4ea6 100644 --- a/KLU/Doc/klu_version.tex +++ b/KLU/Doc/klu_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/KLU -\date{VERSION 2.3.0, Dec 30, 2023} +\date{VERSION 2.3.1, Jan 10, 2024} diff --git a/KLU/Include/klu.h b/KLU/Include/klu.h index 9026138398..5944d0baa5 100644 --- a/KLU/Include/klu.h +++ b/KLU/Include/klu.h @@ -2,7 +2,7 @@ // KLU/Source/klu.h: include file for KLU //------------------------------------------------------------------------------ -// KLU, Copyright (c) 2004-2023, University of Florida. All Rights Reserved. +// KLU, Copyright (c) 2004-2024, University of Florida. All Rights Reserved. // Authors: Timothy A. Davis and Ekanathan Palamadai. // SPDX-License-Identifier: LGPL-2.1+ @@ -823,29 +823,33 @@ void klu_version (int version [3]) ; * #endif */ -#define KLU_DATE "Dec 30, 2023" +#define KLU_DATE "Jan 10, 2024" #define KLU_MAIN_VERSION 2 #define KLU_SUB_VERSION 3 -#define KLU_SUBSUB_VERSION 0 +#define KLU_SUBSUB_VERSION 1 #define KLU_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define KLU_VERSION KLU_VERSION_CODE(KLU_MAIN_VERSION,KLU_SUB_VERSION) +#define KLU_VERSION KLU_VERSION_CODE(2,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "KLU 2.3.0 requires SuiteSparse_config 7.4.0 or later" +#define KLU__VERSION SUITESPARSE__VERCODE(2,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "KLU 2.3.1 requires SuiteSparse_config 7.5.0 or later" #endif -#if AMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "KLU 2.3.0 requires AMD 3.3.0 or later" +#if !defined (AMD__VERSION) || \ + (AMD__VERSION < SUITESPARSE__VERCODE(3,3,1)) +#error "KLU 2.3.1 requires AMD 3.3.1 or later" #endif -#if COLAMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "KLU 2.3.0 requires COLAMD 3.3.0 or later" +#if !defined (COLAMD__VERSION) || \ + (COLAMD__VERSION < SUITESPARSE__VERCODE(3,3,1)) +#error "KLU 2.3.1 requires COLAMD 3.3.1 or later" #endif -#if BTF_VERSION < SUITESPARSE_VER_CODE(2,3) -#error "KLU 2.3.0 requires BTF 2.3.0 or later" +#if !defined (BTF__VERSION) || \ + (BTF__VERSION < SUITESPARSE__VERCODE(2,3,1)) +#error "KLU 2.3.1 requires BTF 2.3.1 or later" #endif #endif diff --git a/KLU/MATLAB/klu_make.m b/KLU/MATLAB/klu_make.m index 26bfc1e836..29fedd61f4 100644 --- a/KLU/MATLAB/klu_make.m +++ b/KLU/MATLAB/klu_make.m @@ -31,6 +31,11 @@ d = ['-silent ' d] ; end +if (ispc) + % MSVC does not define ssize_t + d = [d ' -DNO_SSIZE_T'] ; +end + fprintf ('Compiling KLU ') ; kk = 0 ; diff --git a/KLU/User/klu_cholmod.c b/KLU/User/klu_cholmod.c index 63b9a3c1de..babe44f32d 100644 --- a/KLU/User/klu_cholmod.c +++ b/KLU/User/klu_cholmod.c @@ -23,7 +23,7 @@ #include "cholmod.h" #if (CHOLMOD_VERSION < SUITESPARSE_VER_CODE(5,1)) -#error "KLU:CHOLMOD @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires CHOLMOD 5.1.0 or later" +#error "KLU:CHOLMOD @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ requires CHOLMOD 5.1.1 or later" #endif #define TRUE 1 diff --git a/LAGraph/CMakeLists.txt b/LAGraph/CMakeLists.txt index 975582e662..89205b9be2 100644 --- a/LAGraph/CMakeLists.txt +++ b/LAGraph/CMakeLists.txt @@ -39,10 +39,10 @@ cmake_minimum_required ( VERSION 3.20 ) # LAGraph can be built stand-alone # version of LAGraph -set ( LAGraph_DATE "Dec 30, 2023" ) +set ( LAGraph_DATE "Jan 10, 2024" ) set ( LAGraph_VERSION_MAJOR 1 CACHE STRING "" FORCE ) set ( LAGraph_VERSION_MINOR 1 CACHE STRING "" FORCE ) -set ( LAGraph_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( LAGraph_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building LAGraph version: v" ${LAGraph_VERSION_MAJOR}. @@ -76,6 +76,9 @@ configure_file ( "${PROJECT_SOURCE_DIR}/include/LAGraph.h" NEWLINE_STYLE LF ) +include ( CheckSymbolExists ) +check_symbol_exists ( fmax "math.h" NO_LIBM ) + #------------------------------------------------------------------------------- # code coverage and build type #------------------------------------------------------------------------------- @@ -167,7 +170,11 @@ if ( COVERAGE ) message ( STATUS "OpenMP disabled for test coverage" ) else ( ) if ( LAGRAPH_USE_OPENMP ) - find_package ( OpenMP GLOBAL ) + if ( CMAKE_VERSION VERSION_LESS 3.24 ) + find_package ( OpenMP COMPONENTS C ) + else ( ) + find_package ( OpenMP COMPONENTS C GLOBAL ) + endif ( ) if ( OpenMP_C_FOUND AND BUILD_STATIC_LIBS ) list ( APPEND LAGRAPH_STATIC_LIBS ${OpenMP_C_LIBRARIES} ) endif ( ) @@ -354,7 +361,7 @@ install ( FILES if ( NOT MSVC ) if ( BUILD_STATIC_LIBS ) - if ( NOT WIN32 ) + if ( NOT NO_LIBM ) list ( APPEND LAGRAPH_STATIC_LIBS "m" ) endif ( ) endif ( ) diff --git a/LAGraph/ChangeLog b/LAGraph/ChangeLog index c88d5f479d..a662270958 100644 --- a/LAGraph/ChangeLog +++ b/LAGraph/ChangeLog @@ -1,3 +1,7 @@ +Jan 10, 2024: version 1.1.1 + + * minor update to build system + Dec 30, 2023: version 1.1.0 * major change to build system: by Markus Mützel diff --git a/LAGraph/cmake_modules/SuiteSparsePolicy.cmake b/LAGraph/cmake_modules/SuiteSparsePolicy.cmake index f2d132aa74..20a7fcf784 100644 --- a/LAGraph/cmake_modules/SuiteSparsePolicy.cmake +++ b/LAGraph/cmake_modules/SuiteSparsePolicy.cmake @@ -247,6 +247,19 @@ message ( STATUS "Build type: ${CMAKE_BUILD_TYPE} ") set ( CMAKE_INCLUDE_CURRENT_DIR ON ) +#------------------------------------------------------------------------------- +# Workaround for math.h on old macOS +#------------------------------------------------------------------------------- + +if ( APPLE AND CMAKE_SYSTEM_VERSION VERSION_LESS 11 ) + # Older versions of math.h on the Mac define Real and Imag, which + # conflict with the internal use of those symbols in CHOLMOD, KLU, SPQR, + # UMFPACK, and ParU. + # This can be disabled with -D__NOEXTENSIONS__ + message ( STATUS "MacOS: disable extensions in math.h" ) + add_compile_definitions ( "__NOEXTENSIONS__" ) +endif ( ) + #------------------------------------------------------------------------------- # check if Fortran is available and enabled #------------------------------------------------------------------------------- diff --git a/LAGraph/config/LAGraphConfig.cmake.in b/LAGraph/config/LAGraphConfig.cmake.in index 96ae114d08..ffa6a0e344 100644 --- a/LAGraph/config/LAGraphConfig.cmake.in +++ b/LAGraph/config/LAGraphConfig.cmake.in @@ -53,7 +53,7 @@ endif ( ) # Look for OpenMP if ( @LAGRAPH_HAS_OPENMP@ AND NOT OpenMP_C_FOUND ) - find_dependency ( OpenMP ) + find_dependency ( OpenMP COMPONENTS C ) if ( NOT OpenMP_C_FOUND ) set ( _dependencies_found OFF ) endif ( ) diff --git a/LAGraph/include/LAGraph.h b/LAGraph/include/LAGraph.h index 46a4f45a6d..5834117633 100644 --- a/LAGraph/include/LAGraph.h +++ b/LAGraph/include/LAGraph.h @@ -37,10 +37,10 @@ // See also the LAGraph_Version utility method, which returns these values. // These definitions are derived from LAGraph/CMakeLists.txt. -#define LAGRAPH_DATE "Dec 30, 2023" +#define LAGRAPH_DATE "Jan 10, 2024" #define LAGRAPH_VERSION_MAJOR 1 #define LAGRAPH_VERSION_MINOR 1 -#define LAGRAPH_VERSION_UPDATE 0 +#define LAGRAPH_VERSION_UPDATE 1 //============================================================================== // include files and helper macros diff --git a/LAGraph/src/CMakeLists.txt b/LAGraph/src/CMakeLists.txt index 515103d6b9..cb7b19aa4f 100644 --- a/LAGraph/src/CMakeLists.txt +++ b/LAGraph/src/CMakeLists.txt @@ -17,12 +17,6 @@ include_directories ( utility ) file ( GLOB LAGRAPH_LIB_SOURCES "utility/*.c" "algorithm/*.c" ) -if ( WIN32 ) - set ( M_LIB "" ) -else ( ) - set ( M_LIB "m" ) -endif ( ) - #------------------------------------------------------------------------------- # dynamic lagraph library properties #------------------------------------------------------------------------------- @@ -42,7 +36,10 @@ if ( BUILD_SHARED_LIBS ) set_target_properties ( LAGraph PROPERTIES EXPORT_NO_SYSTEM ON ) endif ( ) - target_link_libraries ( LAGraph PRIVATE GraphBLAS::GraphBLAS ${M_LIB} ) + target_link_libraries ( LAGraph PRIVATE GraphBLAS::GraphBLAS ) + if ( NOT NO_LIBM ) + target_link_libraries ( LAGraph PRIVATE "m" ) + endif ( ) target_include_directories ( LAGraph PUBLIC $ @@ -80,7 +77,9 @@ if ( BUILD_STATIC_LIBS ) else ( ) target_link_libraries ( LAGraph_static PUBLIC GraphBLAS::GraphBLAS ) endif ( ) - target_link_libraries ( LAGraph_static PUBLIC ${M_LIB} ) + if ( NOT NO_LIBM ) + target_link_libraries ( LAGraph_static PUBLIC "m" ) + endif ( ) target_include_directories ( LAGraph_static PUBLIC $ diff --git a/LAGraph/src/benchmark/tc_demo.c b/LAGraph/src/benchmark/tc_demo.c index d8df410122..deffa71a4c 100644 --- a/LAGraph/src/benchmark/tc_demo.c +++ b/LAGraph/src/benchmark/tc_demo.c @@ -149,7 +149,7 @@ int main (int argc, char **argv) // warmup for more accurate timing, and also print # of triangles double ttot = LAGraph_WallClockTime ( ) ; printf ("\nwarmup method: ") ; - int presort = LAGr_TriangleCount_AutoSort ; // = 0 (auto selection) + LAGr_TriangleCount_Presort presort = LAGr_TriangleCount_AutoSort ; print_method (stdout, 6, presort) ; // warmup method: diff --git a/LDL/CMakeLists.txt b/LDL/CMakeLists.txt index f0fd5366ab..cd492dbcca 100644 --- a/LDL/CMakeLists.txt +++ b/LDL/CMakeLists.txt @@ -2,7 +2,7 @@ # SuiteSparse/LDL/CMakeLists.txt: cmake for LDL #------------------------------------------------------------------------------- -# LDL, Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +# LDL, Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: LGPL-2.1+ #------------------------------------------------------------------------------- @@ -11,10 +11,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( LDL_DATE "Dec 30, 2023" ) +set ( LDL_DATE "Jan 10, 2024" ) set ( LDL_VERSION_MAJOR 3 CACHE STRING "" FORCE ) set ( LDL_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( LDL_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( LDL_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building LDL version: v" ${LDL_VERSION_MAJOR}. @@ -44,17 +44,17 @@ include ( SuiteSparsePolicy ) if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) if ( SUITESPARSE_DEMOS ) - find_package ( AMD 3.3.0 + find_package ( AMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::AMD ) - find_package ( AMD 3.3.0 REQUIRED ) + find_package ( AMD 3.3.1 REQUIRED ) endif ( ) endif ( ) endif ( ) diff --git a/LDL/Config/LDLConfig.cmake.in b/LDL/Config/LDLConfig.cmake.in index 0f53fff19d..852ed98853 100644 --- a/LDL/Config/LDLConfig.cmake.in +++ b/LDL/Config/LDLConfig.cmake.in @@ -50,26 +50,12 @@ if ( @SUITESPARSE_IN_BUILD_TREE@ ) find_dependency ( SuiteSparse_config @SUITESPARSE_CONFIG_VERSION_MAJOR@.@SUITESPARSE_CONFIG_VERSION_MINOR@ ) endif ( ) endif ( ) - - if ( NOT TARGET SuiteSparse::AMD ) - # First check in a common build tree - find_dependency ( AMD @AMD_VERSION_MAJOR@.@AMD_VERSION_MINOR@ - PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) - # Then, check in the currently active CMAKE_MODULE_PATH - if ( NOT AMD_FOUND ) - find_dependency ( AMD @AMD_VERSION_MAJOR@.@AMD_VERSION_MINOR@ ) - endif ( ) - endif ( ) - else ( ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) find_dependency ( SuiteSparse_config @SUITESPARSE_CONFIG_VERSION_MAJOR@.@SUITESPARSE_CONFIG_VERSION_MINOR@ ) endif ( ) - if ( NOT TARGET SuiteSparse::AMD ) - find_dependency ( AMD @AMD_VERSION_MAJOR@.@AMD_VERSION_MINOR@ ) - endif ( ) endif ( ) -if ( NOT SuiteSparse_config_FOUND OR NOT AMD_FOUND ) +if ( NOT SuiteSparse_config_FOUND ) set ( _dependencies_found OFF ) endif ( ) diff --git a/LDL/Config/ldl.h.in b/LDL/Config/ldl.h.in index 574e4cd020..f0a58cd766 100644 --- a/LDL/Config/ldl.h.in +++ b/LDL/Config/ldl.h.in @@ -2,7 +2,7 @@ // LDL/Include/ldl.h: include file for the LDL package //------------------------------------------------------------------------------ -// LDL, Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +// LDL, Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. // SPDX-License-Identifier: LGPL-2.1+ //------------------------------------------------------------------------------ @@ -118,11 +118,12 @@ int64_t ldl_l_valid_matrix ( int64_t n, int64_t Ap [ ], int64_t Ai [ ]) ; #define LDL_SUBSUB_VERSION @LDL_VERSION_SUB@ #define LDL_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define LDL_VERSION LDL_VERSION_CODE(LDL_MAIN_VERSION,LDL_SUB_VERSION) +#define LDL_VERSION LDL_VERSION_CODE(@LDL_VERSION_MAJOR@,@LDL_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "LDL @LDL_VERSION_MAJOR@.@LDL_VERSION_MINOR@.@LDL_VERSION_SUB@ requires SuiteSparse_config 7.4 or later" +#define LDL__VERSION SUITESPARSE__VERCODE(@LDL_VERSION_MAJOR@,@LDL_VERSION_MINOR@,@LDL_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "LDL @LDL_VERSION_MAJOR@.@LDL_VERSION_MINOR@.@LDL_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif #endif diff --git a/LDL/Demo/ldlamd.out b/LDL/Demo/ldlamd.out index 57defd4647..6e77bae680 100644 --- a/LDL/Demo/ldlamd.out +++ b/LDL/Demo/ldlamd.out @@ -1,4 +1,4 @@ -LDL version 3.3.0, date: Dec 30, 2023 +LDL version 3.3.1, date: Jan 10, 2024 -------------------------------------------------------- @@ -7,7 +7,7 @@ name: Dense/0 n: 0 entries: 0 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -15,7 +15,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 0 @@ -38,7 +38,7 @@ name: Dense/0 n: 0 entries: 0 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -46,7 +46,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 0 @@ -69,7 +69,7 @@ name: Dense/1 n: 1 entries: 1 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -77,7 +77,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -108,10 +108,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.97627e-17 +relative maxnorm of residual: 0 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.97627e-17 +relative maxnorm of residual: 0 -------------------------------------------------------- @@ -120,7 +120,7 @@ name: Dense/1 n: 1 entries: 2 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -128,7 +128,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -159,10 +159,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 5.51017e-17 +relative maxnorm of residual: 8.32667e-17 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 5.51017e-17 +relative maxnorm of residual: 8.32667e-17 -------------------------------------------------------- @@ -171,7 +171,7 @@ name: Dense/2 n: 2 entries: 4 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -179,7 +179,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -210,10 +210,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 2.53452e-17 +relative maxnorm of residual: 5.55112e-17 Factorize A=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 2.53452e-17 +relative maxnorm of residual: 5.55112e-17 -------------------------------------------------------- @@ -222,7 +222,7 @@ name: Dense/2 n: 2 entries: 5 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -230,7 +230,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -261,10 +261,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 1.08019e-16 +relative maxnorm of residual: 1.11022e-16 Factorize A=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 1.08019e-16 +relative maxnorm of residual: 1.11022e-16 -------------------------------------------------------- @@ -273,7 +273,7 @@ name: Dense/3 n: 3 entries: 9 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -281,7 +281,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -312,10 +312,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.5077e-16 +relative maxnorm of residual: 1.11022e-16 Factorize A=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.5077e-16 +relative maxnorm of residual: 1.11022e-16 -------------------------------------------------------- @@ -324,7 +324,7 @@ name: Dense/3 n: 3 entries: 11 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -332,7 +332,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -363,10 +363,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.27147e-16 +relative maxnorm of residual: 1.38778e-16 Factorize A=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.27147e-16 +relative maxnorm of residual: 1.38778e-16 -------------------------------------------------------- @@ -375,7 +375,7 @@ name: HB/can_24 n: 24 entries: 160 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -383,7 +383,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -426,7 +426,7 @@ name: HB/can_24 n: 24 entries: 188 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -434,7 +434,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -477,7 +477,7 @@ name: FIDAP/ex5 n: 27 entries: 279 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -485,7 +485,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -516,10 +516,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 126 Flop count: 954 -relative maxnorm of residual: 1.95957e-10 +relative maxnorm of residual: 2.59625e-10 Factorize A=LDL' and solve Ax=b Nz in L: 276 Flop count: 4206 -relative maxnorm of residual: 2.29324e-10 +relative maxnorm of residual: 2.72848e-10 -------------------------------------------------------- @@ -528,7 +528,7 @@ name: FIDAP/ex5 n: 27 entries: 325 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -536,7 +536,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -567,10 +567,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 126 Flop count: 954 -relative maxnorm of residual: 2.56588e-10 +relative maxnorm of residual: 3.27418e-10 Factorize A=LDL' and solve Ax=b Nz in L: 276 Flop count: 4206 -relative maxnorm of residual: 2.49687e-10 +relative maxnorm of residual: 2.32376e-10 -------------------------------------------------------- @@ -579,7 +579,7 @@ name: HB/bcsstk01 n: 48 entries: 400 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -587,7 +587,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -618,10 +618,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 441 Flop count: 5961 -relative maxnorm of residual: 1.85693e-13 +relative maxnorm of residual: 2.38712e-13 Factorize A=LDL' and solve Ax=b Nz in L: 829 Flop count: 20103 -relative maxnorm of residual: 3.17781e-13 +relative maxnorm of residual: 2.27374e-13 -------------------------------------------------------- @@ -630,7 +630,7 @@ name: HB/bcsstk01 n: 48 entries: 472 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -638,7 +638,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -669,10 +669,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 441 Flop count: 5961 -relative maxnorm of residual: 2.75176e-13 +relative maxnorm of residual: 2.27374e-13 Factorize A=LDL' and solve Ax=b Nz in L: 829 Flop count: 20103 -relative maxnorm of residual: 3.12705e-13 +relative maxnorm of residual: 3.83693e-13 -------------------------------------------------------- @@ -681,7 +681,7 @@ name: HB/bcsstm01 n: 48 entries: 24 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -689,7 +689,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -732,7 +732,7 @@ name: HB/bcsstm01 n: 48 entries: 26 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -740,7 +740,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -783,7 +783,7 @@ name: Pothen/mesh1e1 n: 48 entries: 306 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -791,7 +791,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -822,10 +822,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 288 Flop count: 2630 -relative maxnorm of residual: 5.6363e-16 +relative maxnorm of residual: 5.96745e-16 Factorize A=LDL' and solve Ax=b Nz in L: 511 Flop count: 7383 -relative maxnorm of residual: 7.07792e-16 +relative maxnorm of residual: 6.93889e-16 -------------------------------------------------------- @@ -834,7 +834,7 @@ name: Pothen/mesh1e1 n: 48 entries: 359 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -842,7 +842,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -873,10 +873,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 288 Flop count: 2630 -relative maxnorm of residual: 5.57005e-16 +relative maxnorm of residual: 5.55112e-16 Factorize A=LDL' and solve Ax=b Nz in L: 511 Flop count: 7383 -relative maxnorm of residual: 8.6996e-16 +relative maxnorm of residual: 5.55112e-16 -------------------------------------------------------- @@ -885,7 +885,7 @@ name: Bai/bfwb62 n: 62 entries: 342 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -893,7 +893,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -924,10 +924,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 226 Flop count: 1472 -relative maxnorm of residual: 5.39685e-16 +relative maxnorm of residual: 5.55112e-16 Factorize A=LDL' and solve Ax=b Nz in L: 662 Flop count: 11350 -relative maxnorm of residual: 8.70386e-16 +relative maxnorm of residual: 1.11022e-15 -------------------------------------------------------- @@ -936,7 +936,7 @@ name: Bai/bfwb62 n: 62 entries: 407 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -944,7 +944,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -975,10 +975,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 226 Flop count: 1472 -relative maxnorm of residual: 3.00082e-14 +relative maxnorm of residual: 5.68434e-14 Factorize A=LDL' and solve Ax=b Nz in L: 662 Flop count: 11350 -relative maxnorm of residual: 1.64732e-12 +relative maxnorm of residual: 2.15827e-12 -------------------------------------------------------- @@ -987,7 +987,7 @@ name: HB/bcsstk02 n: 66 entries: 4356 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -995,7 +995,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1026,10 +1026,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 6.01798e-13 +relative maxnorm of residual: 7.50219e-13 Factorize A=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 6.01798e-13 +relative maxnorm of residual: 7.50219e-13 -------------------------------------------------------- @@ -1038,7 +1038,7 @@ name: HB/bcsstk02 n: 66 entries: 5175 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1046,7 +1046,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1077,10 +1077,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 5.76924e-13 +relative maxnorm of residual: 8.59759e-13 Factorize A=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 5.76924e-13 +relative maxnorm of residual: 8.59759e-13 -------------------------------------------------------- @@ -1089,7 +1089,7 @@ name: HB/bcsstm02 n: 66 entries: 66 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1097,7 +1097,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 66 @@ -1128,10 +1128,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 -------------------------------------------------------- @@ -1140,7 +1140,7 @@ name: HB/bcsstm02 n: 66 entries: 72 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1148,7 +1148,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 66 @@ -1179,10 +1179,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 -------------------------------------------------------- @@ -1232,6 +1232,6 @@ name: Dense/3 n: 3 entries: 9 (invalid Ai) ldlamd: invalid matrix and/or permutation -Largest residual during all tests: 2.56588e-10 +Largest residual during all tests: 3.27418e-10 ldlamd: all tests passed diff --git a/LDL/Demo/ldllamd.out b/LDL/Demo/ldllamd.out index 704115a34f..f3c4001e20 100644 --- a/LDL/Demo/ldllamd.out +++ b/LDL/Demo/ldllamd.out @@ -1,4 +1,4 @@ -LDL version 3.3.0, date: Dec 30, 2023 +LDL version 3.3.1, date: Jan 10, 2024 -------------------------------------------------------- @@ -7,7 +7,7 @@ name: Dense/0 n: 0 entries: 0 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -15,7 +15,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 0 @@ -38,7 +38,7 @@ name: Dense/0 n: 0 entries: 0 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -46,7 +46,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 0 @@ -69,7 +69,7 @@ name: Dense/1 n: 1 entries: 1 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -77,7 +77,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -108,10 +108,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.97627e-17 +relative maxnorm of residual: 0 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.97627e-17 +relative maxnorm of residual: 0 -------------------------------------------------------- @@ -120,7 +120,7 @@ name: Dense/1 n: 1 entries: 2 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -128,7 +128,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -159,10 +159,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 5.51017e-17 +relative maxnorm of residual: 8.32667e-17 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 5.51017e-17 +relative maxnorm of residual: 8.32667e-17 -------------------------------------------------------- @@ -171,7 +171,7 @@ name: Dense/2 n: 2 entries: 4 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -179,7 +179,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -210,10 +210,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 2.53452e-17 +relative maxnorm of residual: 5.55112e-17 Factorize A=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 2.53452e-17 +relative maxnorm of residual: 5.55112e-17 -------------------------------------------------------- @@ -222,7 +222,7 @@ name: Dense/2 n: 2 entries: 5 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -230,7 +230,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -261,10 +261,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 1.08019e-16 +relative maxnorm of residual: 1.11022e-16 Factorize A=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 1.08019e-16 +relative maxnorm of residual: 1.11022e-16 -------------------------------------------------------- @@ -273,7 +273,7 @@ name: Dense/3 n: 3 entries: 9 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -281,7 +281,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -312,10 +312,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.5077e-16 +relative maxnorm of residual: 1.11022e-16 Factorize A=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.5077e-16 +relative maxnorm of residual: 1.11022e-16 -------------------------------------------------------- @@ -324,7 +324,7 @@ name: Dense/3 n: 3 entries: 11 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -332,7 +332,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -363,10 +363,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.27147e-16 +relative maxnorm of residual: 1.38778e-16 Factorize A=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.27147e-16 +relative maxnorm of residual: 1.38778e-16 -------------------------------------------------------- @@ -375,7 +375,7 @@ name: HB/can_24 n: 24 entries: 160 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -383,7 +383,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -426,7 +426,7 @@ name: HB/can_24 n: 24 entries: 188 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -434,7 +434,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -477,7 +477,7 @@ name: FIDAP/ex5 n: 27 entries: 279 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -485,7 +485,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -516,10 +516,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 126 Flop count: 954 -relative maxnorm of residual: 1.95957e-10 +relative maxnorm of residual: 2.59625e-10 Factorize A=LDL' and solve Ax=b Nz in L: 276 Flop count: 4206 -relative maxnorm of residual: 2.29324e-10 +relative maxnorm of residual: 2.72848e-10 -------------------------------------------------------- @@ -528,7 +528,7 @@ name: FIDAP/ex5 n: 27 entries: 325 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -536,7 +536,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -567,10 +567,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 126 Flop count: 954 -relative maxnorm of residual: 2.56588e-10 +relative maxnorm of residual: 3.27418e-10 Factorize A=LDL' and solve Ax=b Nz in L: 276 Flop count: 4206 -relative maxnorm of residual: 2.49687e-10 +relative maxnorm of residual: 2.32376e-10 -------------------------------------------------------- @@ -579,7 +579,7 @@ name: HB/bcsstk01 n: 48 entries: 400 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -587,7 +587,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -618,10 +618,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 441 Flop count: 5961 -relative maxnorm of residual: 1.85693e-13 +relative maxnorm of residual: 2.38712e-13 Factorize A=LDL' and solve Ax=b Nz in L: 829 Flop count: 20103 -relative maxnorm of residual: 3.17781e-13 +relative maxnorm of residual: 2.27374e-13 -------------------------------------------------------- @@ -630,7 +630,7 @@ name: HB/bcsstk01 n: 48 entries: 472 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -638,7 +638,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -669,10 +669,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 441 Flop count: 5961 -relative maxnorm of residual: 2.75176e-13 +relative maxnorm of residual: 2.27374e-13 Factorize A=LDL' and solve Ax=b Nz in L: 829 Flop count: 20103 -relative maxnorm of residual: 3.12705e-13 +relative maxnorm of residual: 3.83693e-13 -------------------------------------------------------- @@ -681,7 +681,7 @@ name: HB/bcsstm01 n: 48 entries: 24 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -689,7 +689,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -732,7 +732,7 @@ name: HB/bcsstm01 n: 48 entries: 26 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -740,7 +740,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -783,7 +783,7 @@ name: Pothen/mesh1e1 n: 48 entries: 306 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -791,7 +791,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -822,10 +822,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 288 Flop count: 2630 -relative maxnorm of residual: 5.6363e-16 +relative maxnorm of residual: 5.96745e-16 Factorize A=LDL' and solve Ax=b Nz in L: 511 Flop count: 7383 -relative maxnorm of residual: 7.07792e-16 +relative maxnorm of residual: 6.93889e-16 -------------------------------------------------------- @@ -834,7 +834,7 @@ name: Pothen/mesh1e1 n: 48 entries: 359 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -842,7 +842,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -873,10 +873,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 288 Flop count: 2630 -relative maxnorm of residual: 5.57005e-16 +relative maxnorm of residual: 5.55112e-16 Factorize A=LDL' and solve Ax=b Nz in L: 511 Flop count: 7383 -relative maxnorm of residual: 8.6996e-16 +relative maxnorm of residual: 5.55112e-16 -------------------------------------------------------- @@ -885,7 +885,7 @@ name: Bai/bfwb62 n: 62 entries: 342 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -893,7 +893,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -924,10 +924,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 226 Flop count: 1472 -relative maxnorm of residual: 5.39685e-16 +relative maxnorm of residual: 5.55112e-16 Factorize A=LDL' and solve Ax=b Nz in L: 662 Flop count: 11350 -relative maxnorm of residual: 8.70386e-16 +relative maxnorm of residual: 1.11022e-15 -------------------------------------------------------- @@ -936,7 +936,7 @@ name: Bai/bfwb62 n: 62 entries: 407 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -944,7 +944,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -975,10 +975,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 226 Flop count: 1472 -relative maxnorm of residual: 3.00082e-14 +relative maxnorm of residual: 5.68434e-14 Factorize A=LDL' and solve Ax=b Nz in L: 662 Flop count: 11350 -relative maxnorm of residual: 1.64732e-12 +relative maxnorm of residual: 2.15827e-12 -------------------------------------------------------- @@ -987,7 +987,7 @@ name: HB/bcsstk02 n: 66 entries: 4356 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -995,7 +995,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1026,10 +1026,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 6.01798e-13 +relative maxnorm of residual: 7.50219e-13 Factorize A=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 6.01798e-13 +relative maxnorm of residual: 7.50219e-13 -------------------------------------------------------- @@ -1038,7 +1038,7 @@ name: HB/bcsstk02 n: 66 entries: 5175 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1046,7 +1046,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1077,10 +1077,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 5.76924e-13 +relative maxnorm of residual: 8.59759e-13 Factorize A=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 5.76924e-13 +relative maxnorm of residual: 8.59759e-13 -------------------------------------------------------- @@ -1089,7 +1089,7 @@ name: HB/bcsstm02 n: 66 entries: 66 -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1097,7 +1097,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 66 @@ -1128,10 +1128,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 -------------------------------------------------------- @@ -1140,7 +1140,7 @@ name: HB/bcsstm02 n: 66 entries: 72 (jumbled version) -------------------------------------------------------- -AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering +AMD version 3.3.1, Jan 10, 2024: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1148,7 +1148,7 @@ AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.3.0, Dec 30, 2023, results: +AMD version 3.3.1, Jan 10, 2024, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 66 @@ -1179,10 +1179,10 @@ AMD version 3.3.0, Dec 30, 2023, results: Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 -------------------------------------------------------- @@ -1232,6 +1232,6 @@ name: Dense/3 n: 3 entries: 9 (invalid Ai) ldlamd: invalid matrix and/or permutation -Largest residual during all tests: 2.56588e-10 +Largest residual during all tests: 3.27418e-10 ldlamd: all tests passed diff --git a/LDL/Demo/ldllmain.out b/LDL/Demo/ldllmain.out index 5e8f824919..5de32dd310 100644 --- a/LDL/Demo/ldllmain.out +++ b/LDL/Demo/ldllmain.out @@ -1,4 +1,4 @@ -LDL version 3.3.0, date: Dec 30, 2023 +LDL version 3.3.1, date: Jan 10, 2024 -------------------------------------------------------- @@ -34,10 +34,10 @@ name: Dense/1 n: 1 entries: 1 Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.97627e-17 +relative maxnorm of residual: 0 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.97627e-17 +relative maxnorm of residual: 0 -------------------------------------------------------- @@ -47,10 +47,10 @@ name: Dense/1 n: 1 entries: 2 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 5.51017e-17 +relative maxnorm of residual: 8.32667e-17 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 5.51017e-17 +relative maxnorm of residual: 8.32667e-17 -------------------------------------------------------- @@ -60,10 +60,10 @@ name: Dense/2 n: 2 entries: 4 Factorize PAP'=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 2.53452e-17 +relative maxnorm of residual: 5.55112e-17 Factorize A=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 2.53452e-17 +relative maxnorm of residual: 5.55112e-17 -------------------------------------------------------- @@ -73,10 +73,10 @@ name: Dense/2 n: 2 entries: 5 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 1.08019e-16 +relative maxnorm of residual: 1.11022e-16 Factorize A=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 1.08019e-16 +relative maxnorm of residual: 1.11022e-16 -------------------------------------------------------- @@ -86,10 +86,10 @@ name: Dense/3 n: 3 entries: 9 Factorize PAP'=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.5077e-16 +relative maxnorm of residual: 1.11022e-16 Factorize A=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.5077e-16 +relative maxnorm of residual: 1.11022e-16 -------------------------------------------------------- @@ -99,10 +99,10 @@ name: Dense/3 n: 3 entries: 11 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.27147e-16 +relative maxnorm of residual: 1.38778e-16 Factorize A=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.27147e-16 +relative maxnorm of residual: 1.38778e-16 -------------------------------------------------------- @@ -138,10 +138,10 @@ name: FIDAP/ex5 n: 27 entries: 279 Factorize PAP'=LDL' and solve Ax=b Nz in L: 126 Flop count: 954 -relative maxnorm of residual: 1.95957e-10 +relative maxnorm of residual: 2.59625e-10 Factorize A=LDL' and solve Ax=b Nz in L: 276 Flop count: 4206 -relative maxnorm of residual: 2.29324e-10 +relative maxnorm of residual: 2.72848e-10 -------------------------------------------------------- @@ -151,10 +151,10 @@ name: FIDAP/ex5 n: 27 entries: 325 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 126 Flop count: 954 -relative maxnorm of residual: 2.56588e-10 +relative maxnorm of residual: 3.27418e-10 Factorize A=LDL' and solve Ax=b Nz in L: 276 Flop count: 4206 -relative maxnorm of residual: 2.49687e-10 +relative maxnorm of residual: 2.32376e-10 -------------------------------------------------------- @@ -164,10 +164,10 @@ name: HB/bcsstk01 n: 48 entries: 400 Factorize PAP'=LDL' and solve Ax=b Nz in L: 441 Flop count: 5961 -relative maxnorm of residual: 1.85693e-13 +relative maxnorm of residual: 2.38712e-13 Factorize A=LDL' and solve Ax=b Nz in L: 829 Flop count: 20103 -relative maxnorm of residual: 3.17781e-13 +relative maxnorm of residual: 2.27374e-13 -------------------------------------------------------- @@ -177,10 +177,10 @@ name: HB/bcsstk01 n: 48 entries: 472 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 441 Flop count: 5961 -relative maxnorm of residual: 2.75176e-13 +relative maxnorm of residual: 2.27374e-13 Factorize A=LDL' and solve Ax=b Nz in L: 829 Flop count: 20103 -relative maxnorm of residual: 3.12705e-13 +relative maxnorm of residual: 3.83693e-13 -------------------------------------------------------- @@ -216,10 +216,10 @@ name: Pothen/mesh1e1 n: 48 entries: 306 Factorize PAP'=LDL' and solve Ax=b Nz in L: 288 Flop count: 2630 -relative maxnorm of residual: 5.6363e-16 +relative maxnorm of residual: 5.96745e-16 Factorize A=LDL' and solve Ax=b Nz in L: 511 Flop count: 7383 -relative maxnorm of residual: 7.07792e-16 +relative maxnorm of residual: 6.93889e-16 -------------------------------------------------------- @@ -229,10 +229,10 @@ name: Pothen/mesh1e1 n: 48 entries: 359 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 288 Flop count: 2630 -relative maxnorm of residual: 5.57005e-16 +relative maxnorm of residual: 5.55112e-16 Factorize A=LDL' and solve Ax=b Nz in L: 511 Flop count: 7383 -relative maxnorm of residual: 8.6996e-16 +relative maxnorm of residual: 5.55112e-16 -------------------------------------------------------- @@ -242,10 +242,10 @@ name: Bai/bfwb62 n: 62 entries: 342 Factorize PAP'=LDL' and solve Ax=b Nz in L: 226 Flop count: 1472 -relative maxnorm of residual: 5.39685e-16 +relative maxnorm of residual: 5.55112e-16 Factorize A=LDL' and solve Ax=b Nz in L: 662 Flop count: 11350 -relative maxnorm of residual: 8.70386e-16 +relative maxnorm of residual: 1.11022e-15 -------------------------------------------------------- @@ -255,10 +255,10 @@ name: Bai/bfwb62 n: 62 entries: 407 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 226 Flop count: 1472 -relative maxnorm of residual: 3.00082e-14 +relative maxnorm of residual: 5.68434e-14 Factorize A=LDL' and solve Ax=b Nz in L: 662 Flop count: 11350 -relative maxnorm of residual: 1.64732e-12 +relative maxnorm of residual: 2.15827e-12 -------------------------------------------------------- @@ -268,10 +268,10 @@ name: HB/bcsstk02 n: 66 entries: 4356 Factorize PAP'=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 6.01798e-13 +relative maxnorm of residual: 7.50219e-13 Factorize A=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 6.01798e-13 +relative maxnorm of residual: 7.50219e-13 -------------------------------------------------------- @@ -281,10 +281,10 @@ name: HB/bcsstk02 n: 66 entries: 5175 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 5.76924e-13 +relative maxnorm of residual: 8.59759e-13 Factorize A=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 5.76924e-13 +relative maxnorm of residual: 8.59759e-13 -------------------------------------------------------- @@ -294,10 +294,10 @@ name: HB/bcsstm02 n: 66 entries: 66 Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 -------------------------------------------------------- @@ -307,10 +307,10 @@ name: HB/bcsstm02 n: 66 entries: 72 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 -------------------------------------------------------- @@ -360,6 +360,6 @@ name: Dense/3 n: 3 entries: 9 (invalid Ai) ldlmain: invalid matrix and/or permutation -Largest residual during all tests: 2.56588e-10 +Largest residual during all tests: 3.27418e-10 ldlmain: all tests passed diff --git a/LDL/Demo/ldlmain.c b/LDL/Demo/ldlmain.c index 29da7515bb..d0f9fae2fc 100644 --- a/LDL/Demo/ldlmain.c +++ b/LDL/Demo/ldlmain.c @@ -47,7 +47,7 @@ #define PROGRAM "ldlamd" #if (AMD_VERSION < SUITESPARSE_VER_CODE(3,3)) -#error "LDL:AMD @LDL_VERSION_MAJOR@.@LDL_VERSION_MINOR@.@LDL_VERSION_SUB@ requires AMD 3.3.0 or later" +#error "LDL:AMD @LDL_VERSION_MAJOR@.@LDL_VERSION_MINOR@.@LDL_VERSION_SUB@ requires AMD 3.3.1 or later" #endif #else diff --git a/LDL/Demo/ldlmain.out b/LDL/Demo/ldlmain.out index 5e8f824919..5de32dd310 100644 --- a/LDL/Demo/ldlmain.out +++ b/LDL/Demo/ldlmain.out @@ -1,4 +1,4 @@ -LDL version 3.3.0, date: Dec 30, 2023 +LDL version 3.3.1, date: Jan 10, 2024 -------------------------------------------------------- @@ -34,10 +34,10 @@ name: Dense/1 n: 1 entries: 1 Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.97627e-17 +relative maxnorm of residual: 0 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.97627e-17 +relative maxnorm of residual: 0 -------------------------------------------------------- @@ -47,10 +47,10 @@ name: Dense/1 n: 1 entries: 2 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 5.51017e-17 +relative maxnorm of residual: 8.32667e-17 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 5.51017e-17 +relative maxnorm of residual: 8.32667e-17 -------------------------------------------------------- @@ -60,10 +60,10 @@ name: Dense/2 n: 2 entries: 4 Factorize PAP'=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 2.53452e-17 +relative maxnorm of residual: 5.55112e-17 Factorize A=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 2.53452e-17 +relative maxnorm of residual: 5.55112e-17 -------------------------------------------------------- @@ -73,10 +73,10 @@ name: Dense/2 n: 2 entries: 5 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 1.08019e-16 +relative maxnorm of residual: 1.11022e-16 Factorize A=LDL' and solve Ax=b Nz in L: 1 Flop count: 3 -relative maxnorm of residual: 1.08019e-16 +relative maxnorm of residual: 1.11022e-16 -------------------------------------------------------- @@ -86,10 +86,10 @@ name: Dense/3 n: 3 entries: 9 Factorize PAP'=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.5077e-16 +relative maxnorm of residual: 1.11022e-16 Factorize A=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.5077e-16 +relative maxnorm of residual: 1.11022e-16 -------------------------------------------------------- @@ -99,10 +99,10 @@ name: Dense/3 n: 3 entries: 11 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.27147e-16 +relative maxnorm of residual: 1.38778e-16 Factorize A=LDL' and solve Ax=b Nz in L: 3 Flop count: 11 -relative maxnorm of residual: 1.27147e-16 +relative maxnorm of residual: 1.38778e-16 -------------------------------------------------------- @@ -138,10 +138,10 @@ name: FIDAP/ex5 n: 27 entries: 279 Factorize PAP'=LDL' and solve Ax=b Nz in L: 126 Flop count: 954 -relative maxnorm of residual: 1.95957e-10 +relative maxnorm of residual: 2.59625e-10 Factorize A=LDL' and solve Ax=b Nz in L: 276 Flop count: 4206 -relative maxnorm of residual: 2.29324e-10 +relative maxnorm of residual: 2.72848e-10 -------------------------------------------------------- @@ -151,10 +151,10 @@ name: FIDAP/ex5 n: 27 entries: 325 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 126 Flop count: 954 -relative maxnorm of residual: 2.56588e-10 +relative maxnorm of residual: 3.27418e-10 Factorize A=LDL' and solve Ax=b Nz in L: 276 Flop count: 4206 -relative maxnorm of residual: 2.49687e-10 +relative maxnorm of residual: 2.32376e-10 -------------------------------------------------------- @@ -164,10 +164,10 @@ name: HB/bcsstk01 n: 48 entries: 400 Factorize PAP'=LDL' and solve Ax=b Nz in L: 441 Flop count: 5961 -relative maxnorm of residual: 1.85693e-13 +relative maxnorm of residual: 2.38712e-13 Factorize A=LDL' and solve Ax=b Nz in L: 829 Flop count: 20103 -relative maxnorm of residual: 3.17781e-13 +relative maxnorm of residual: 2.27374e-13 -------------------------------------------------------- @@ -177,10 +177,10 @@ name: HB/bcsstk01 n: 48 entries: 472 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 441 Flop count: 5961 -relative maxnorm of residual: 2.75176e-13 +relative maxnorm of residual: 2.27374e-13 Factorize A=LDL' and solve Ax=b Nz in L: 829 Flop count: 20103 -relative maxnorm of residual: 3.12705e-13 +relative maxnorm of residual: 3.83693e-13 -------------------------------------------------------- @@ -216,10 +216,10 @@ name: Pothen/mesh1e1 n: 48 entries: 306 Factorize PAP'=LDL' and solve Ax=b Nz in L: 288 Flop count: 2630 -relative maxnorm of residual: 5.6363e-16 +relative maxnorm of residual: 5.96745e-16 Factorize A=LDL' and solve Ax=b Nz in L: 511 Flop count: 7383 -relative maxnorm of residual: 7.07792e-16 +relative maxnorm of residual: 6.93889e-16 -------------------------------------------------------- @@ -229,10 +229,10 @@ name: Pothen/mesh1e1 n: 48 entries: 359 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 288 Flop count: 2630 -relative maxnorm of residual: 5.57005e-16 +relative maxnorm of residual: 5.55112e-16 Factorize A=LDL' and solve Ax=b Nz in L: 511 Flop count: 7383 -relative maxnorm of residual: 8.6996e-16 +relative maxnorm of residual: 5.55112e-16 -------------------------------------------------------- @@ -242,10 +242,10 @@ name: Bai/bfwb62 n: 62 entries: 342 Factorize PAP'=LDL' and solve Ax=b Nz in L: 226 Flop count: 1472 -relative maxnorm of residual: 5.39685e-16 +relative maxnorm of residual: 5.55112e-16 Factorize A=LDL' and solve Ax=b Nz in L: 662 Flop count: 11350 -relative maxnorm of residual: 8.70386e-16 +relative maxnorm of residual: 1.11022e-15 -------------------------------------------------------- @@ -255,10 +255,10 @@ name: Bai/bfwb62 n: 62 entries: 407 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 226 Flop count: 1472 -relative maxnorm of residual: 3.00082e-14 +relative maxnorm of residual: 5.68434e-14 Factorize A=LDL' and solve Ax=b Nz in L: 662 Flop count: 11350 -relative maxnorm of residual: 1.64732e-12 +relative maxnorm of residual: 2.15827e-12 -------------------------------------------------------- @@ -268,10 +268,10 @@ name: HB/bcsstk02 n: 66 entries: 4356 Factorize PAP'=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 6.01798e-13 +relative maxnorm of residual: 7.50219e-13 Factorize A=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 6.01798e-13 +relative maxnorm of residual: 7.50219e-13 -------------------------------------------------------- @@ -281,10 +281,10 @@ name: HB/bcsstk02 n: 66 entries: 5175 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 5.76924e-13 +relative maxnorm of residual: 8.59759e-13 Factorize A=LDL' and solve Ax=b Nz in L: 2145 Flop count: 97955 -relative maxnorm of residual: 5.76924e-13 +relative maxnorm of residual: 8.59759e-13 -------------------------------------------------------- @@ -294,10 +294,10 @@ name: HB/bcsstm02 n: 66 entries: 66 Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 -------------------------------------------------------- @@ -307,10 +307,10 @@ name: HB/bcsstm02 n: 66 entries: 72 (jumbled version) Factorize PAP'=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 Factorize A=LDL' and solve Ax=b Nz in L: 0 Flop count: 0 -relative maxnorm of residual: 1.3857e-16 +relative maxnorm of residual: 2.22045e-16 -------------------------------------------------------- @@ -360,6 +360,6 @@ name: Dense/3 n: 3 entries: 9 (invalid Ai) ldlmain: invalid matrix and/or permutation -Largest residual during all tests: 2.56588e-10 +Largest residual during all tests: 3.27418e-10 ldlmain: all tests passed diff --git a/LDL/Demo/ldlsimple.out b/LDL/Demo/ldlsimple.out index 8e46adbc9c..3eaeafdda2 100644 --- a/LDL/Demo/ldlsimple.out +++ b/LDL/Demo/ldlsimple.out @@ -1,4 +1,4 @@ -LDL 3.3.0 in SuiteSparse 7.4.0 +LDL 3.3.1 in SuiteSparse 7.5.0 Nonzeros in L, excluding diagonal: 13 x [0] = 0.1 x [1] = 0.2 diff --git a/LDL/Doc/ChangeLog b/LDL/Doc/ChangeLog index 4193d13d00..566d85214d 100644 --- a/LDL/Doc/ChangeLog +++ b/LDL/Doc/ChangeLog @@ -1,3 +1,7 @@ +Jan 10, 2024: version 3.3.1 + + * minor updates to build system + Dec 30, 2023: version 3.3.0 * major change to build system: by Markus Mützel diff --git a/LDL/Doc/ldl_userguide.pdf b/LDL/Doc/ldl_userguide.pdf index fa90817ec5..dd48155ac3 100644 Binary files a/LDL/Doc/ldl_userguide.pdf and b/LDL/Doc/ldl_userguide.pdf differ diff --git a/LDL/Doc/ldl_version.tex b/LDL/Doc/ldl_version.tex index 9fb04225e8..744711f543 100644 --- a/LDL/Doc/ldl_version.tex +++ b/LDL/Doc/ldl_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/LDL -\date{VERSION 3.3.0, Dec 30, 2023} +\date{VERSION 3.3.1, Jan 10, 2024} diff --git a/LDL/Include/ldl.h b/LDL/Include/ldl.h index 05bbbf89c0..7a5a75a42a 100644 --- a/LDL/Include/ldl.h +++ b/LDL/Include/ldl.h @@ -2,7 +2,7 @@ // LDL/Include/ldl.h: include file for the LDL package //------------------------------------------------------------------------------ -// LDL, Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +// LDL, Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. // SPDX-License-Identifier: LGPL-2.1+ //------------------------------------------------------------------------------ @@ -112,17 +112,18 @@ int64_t ldl_l_valid_matrix ( int64_t n, int64_t Ap [ ], int64_t Ai [ ]) ; /* === LDL version ========================================================== */ /* ========================================================================== */ -#define LDL_DATE "Dec 30, 2023" +#define LDL_DATE "Jan 10, 2024" #define LDL_MAIN_VERSION 3 #define LDL_SUB_VERSION 3 -#define LDL_SUBSUB_VERSION 0 +#define LDL_SUBSUB_VERSION 1 #define LDL_VERSION_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define LDL_VERSION LDL_VERSION_CODE(LDL_MAIN_VERSION,LDL_SUB_VERSION) +#define LDL_VERSION LDL_VERSION_CODE(3,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "LDL 3.3.0 requires SuiteSparse_config 7.4 or later" +#define LDL__VERSION SUITESPARSE__VERCODE(3,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "LDL 3.3.1 requires SuiteSparse_config 7.5.0 or later" #endif #endif diff --git a/LDL/Makefile b/LDL/Makefile index d2153efaf7..e7365984ec 100644 --- a/LDL/Makefile +++ b/LDL/Makefile @@ -52,18 +52,18 @@ all: library demos: library ( cd build && cmake $(CMAKE_OPTIONS) -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j${JOBS} ) - ./build/ldlsimple > ./build/ldlsimple.out - - diff --strip-trailing-cr ./Demo/ldlsimple.out ./build/ldlsimple.out - ./build/ldllsimple > ./build/ldllsimple.out - - diff --strip-trailing-cr ./Demo/ldllsimple.out ./build/ldllsimple.out - ./build/ldlmain > ./build/ldlmain.out - - diff --strip-trailing-cr ./Demo/ldlmain.out ./build/ldlmain.out - ./build/ldllmain > ./build/ldllmain.out - - diff --strip-trailing-cr ./Demo/ldllmain.out ./build/ldllmain.out - ./build/ldlamd > ./build/ldlamd.out - - diff --strip-trailing-cr ./Demo/ldlamd.out ./build/ldlamd.out - ./build/ldllamd > ./build/ldllamd.out - - diff --strip-trailing-cr ./Demo/ldllamd.out ./build/ldllamd.out + ./build/ldlsimple > ./build/ldlsimple.out && ( command -v d2u && d2u ./build/ldlsimple.out || true ) + - diff ./Demo/ldlsimple.out ./build/ldlsimple.out + ./build/ldllsimple > ./build/ldllsimple.out && ( command -v d2u && d2u ./build/ldllsimple.out || true ) + - diff ./Demo/ldllsimple.out ./build/ldllsimple.out + ./build/ldlmain > ./build/ldlmain.out && ( command -v d2u && d2u ./build/ldlmain.out || true ) + - diff ./Demo/ldlmain.out ./build/ldlmain.out + ./build/ldllmain > ./build/ldllmain.out && ( command -v d2u && d2u ./build/ldllmain.out || true ) + - diff ./Demo/ldllmain.out ./build/ldllmain.out + ./build/ldlamd > ./build/ldlamd.out && ( command -v d2u && d2u ./build/ldlamd.out || true ) + - diff ./Demo/ldlamd.out ./build/ldlamd.out + ./build/ldllamd > ./build/ldllamd.out && ( command -v d2u && d2u ./build/ldllamd.out || true ) + - diff ./Demo/ldllamd.out ./build/ldllamd.out # just compile after running cmake; do not run cmake again remake: diff --git a/LICENSE.txt b/LICENSE.txt index a2a45b52d0..8c6d47346c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -298,10 +298,10 @@ found in the lists below. CHOLMOD/Include/* files. Copyright (C) 2005-2023 - Include/cholmod.h LGPL - Include/cholmod_internal.h LGPL - Include/cholmod_template.h LGPL - Include/cholmod_types.h LGPL + CHOLMOD/Include/cholmod.h SPDX-License-Identifier: Apache-2.0 + CHOLMOD/Include/cholmod_internal.h SPDX-License-Identifier: Apache-2.0 + CHOLMOD/Include/cholmod_template.h SPDX-License-Identifier: Apache-2.0 + CHOLMOD/Include/cholmod_types.h SPDX-License-Identifier: Apache-2.0 -------------------------------------------------------------------------------- ==> MATLAB/License.txt <== diff --git a/Mongoose/CMakeLists.txt b/Mongoose/CMakeLists.txt index 03a5224019..c65f218261 100644 --- a/Mongoose/CMakeLists.txt +++ b/Mongoose/CMakeLists.txt @@ -35,11 +35,11 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( Mongoose_DATE "Dec 30, 2023" ) -set ( Mongoose_NUMERIC_DATE "2023-12-30" ) +set ( Mongoose_DATE "Jan 10, 2024" ) +set ( Mongoose_NUMERIC_DATE "2024-01-10" ) set ( Mongoose_VERSION_MAJOR 3 CACHE STRING "" FORCE ) set ( Mongoose_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( Mongoose_VERSION_PATCH 0 CACHE STRING "" FORCE ) +set ( Mongoose_VERSION_PATCH 1 CACHE STRING "" FORCE ) message ( STATUS "Building Mongoose version: v" ${Mongoose_VERSION_MAJOR}. @@ -69,10 +69,10 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) endif ( ) @@ -223,6 +223,8 @@ if ( BUILD_STATIC_LIBS ) else ( ) target_link_libraries ( Mongoose_static PUBLIC SuiteSparse::SuiteSparseConfig ) endif ( ) + + target_compile_definitions ( Mongoose_static PUBLIC MONGOOSE_STATIC ) endif ( ) if ( BUILD_SHARED_LIBS ) @@ -249,50 +251,33 @@ if ( BUILD_SHARED_LIBS ) "$" ) target_include_directories ( Mongoose PRIVATE . ) + + target_compile_definitions ( Mongoose PRIVATE MONGOOSE_BUILDING ) endif ( ) #------------------------------------------------------------------------------- -# Build the Mongoose debug/test library -add_library ( Mongoose_static_dbg STATIC ${MONGOOSE_LIB_FILES} ) -set_target_properties ( Mongoose_static_dbg PROPERTIES - OUTPUT_NAME suitesparse_mongoose_dbg ) - -if ( TARGET SuiteSparse::SuiteSparseConfig_static ) - target_link_libraries ( Mongoose_static_dbg SuiteSparse::SuiteSparseConfig_static ) -else ( ) - target_link_libraries ( Mongoose_static_dbg SuiteSparse::SuiteSparseConfig ) -endif ( ) - # Build the Mongoose executable add_executable ( mongoose_exe ${EXE_FILES} ) set_target_properties ( mongoose_exe PROPERTIES OUTPUT_NAME suitesparse_mongoose ) -if ( BUILD_STATIC_LIBS ) - target_link_libraries ( mongoose_exe Mongoose_static ) -else ( ) - target_link_libraries ( mongoose_exe Mongoose ) -endif ( ) -if ( TARGET SuiteSparse::SuiteSparseConfig_static ) - target_link_libraries ( mongoose_exe SuiteSparse::SuiteSparseConfig_static ) +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( mongoose_exe PRIVATE Mongoose ) else ( ) - target_link_libraries ( mongoose_exe SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( mongoose_exe PRIVATE Mongoose_static ) endif ( ) +target_link_libraries ( mongoose_exe PRIVATE SuiteSparse::SuiteSparseConfig ) # Build the Demo executable add_executable ( demo_exe ${DEMO_FILES} ) set_target_properties ( demo_exe PROPERTIES OUTPUT_NAME demo ) -if ( BUILD_STATIC_LIBS ) - target_link_libraries ( demo_exe Mongoose_static ) -else ( ) +if ( BUILD_SHARED_LIBS ) target_link_libraries ( demo_exe Mongoose ) -endif ( ) -if ( TARGET SuiteSparse::SuiteSparseConfig_static ) - target_link_libraries ( demo_exe SuiteSparse::SuiteSparseConfig_static ) else ( ) - target_link_libraries ( demo_exe SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( demo_exe Mongoose_static ) endif ( ) +target_link_libraries ( demo_exe SuiteSparse::SuiteSparseConfig ) # Coverage and Unit Testing Setup include ( CTest ) @@ -305,28 +290,28 @@ if ( BUILD_TESTING ) add_executable ( mongoose_test_io Tests/Mongoose_Test_IO.cpp Tests/Mongoose_Test_IO_exe.cpp ) - target_link_libraries ( mongoose_test_io Mongoose_static_dbg ) - if ( TARGET SuiteSparse::SuiteSparseConfig_static ) - target_link_libraries ( mongoose_test_io SuiteSparse::SuiteSparseConfig_static ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( mongoose_test_io PRIVATE Mongoose ) else ( ) - target_link_libraries ( mongoose_test_io SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( mongoose_test_io PRIVATE Mongoose_static ) endif ( ) + target_link_libraries ( mongoose_test_io PRIVATE SuiteSparse::SuiteSparseConfig ) set_target_properties ( mongoose_test_io PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH} ) add_test ( NAME Mongoose_IO_Test COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Tests/runTests -min 1 -max 15 -t io -k ) - if ( WIN32 AND BUILD_SHARED_LIBS ) - set_tests_properties ( Mongoose_IO_Test PROPERTIES - ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$" ) - endif ( ) - # Edge Separator Tests add_executable ( mongoose_test_edgesep Tests/Mongoose_Test_EdgeSeparator.cpp Tests/Mongoose_Test_EdgeSeparator_exe.cpp) - target_link_libraries ( mongoose_test_edgesep Mongoose_static_dbg ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( mongoose_test_edgesep PRIVATE Mongoose ) + else ( ) + target_link_libraries ( mongoose_test_edgesep PRIVATE Mongoose_static ) + endif ( ) + target_link_libraries ( mongoose_test_edgesep PRIVATE SuiteSparse::SuiteSparseConfig ) set_target_properties ( mongoose_test_edgesep PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH} ) @@ -339,41 +324,32 @@ if ( BUILD_TESTING ) add_test ( NAME Mongoose_Target_Split_Test COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Tests/runTests -min 1 -max 15 -t edgesep -s 0.3 ) - if ( WIN32 AND BUILD_SHARED_LIBS ) - set_tests_properties ( Mongoose_Edge_Separator_Test Mongoose_Edge_Separator_Test_2 Mongoose_Weighted_Edge_Separator_Test Mongoose_Target_Split_Test PROPERTIES - ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$" ) - endif ( ) - # Memory Tests add_executable ( mongoose_test_memory Tests/Mongoose_Test_Memory.cpp Tests/Mongoose_Test_Memory_exe.cpp) - target_link_libraries ( mongoose_test_memory Mongoose_static_dbg ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( mongoose_test_memory PRIVATE Mongoose ) + else ( ) + target_link_libraries ( mongoose_test_memory PRIVATE Mongoose_static ) + endif ( ) + target_link_libraries ( mongoose_test_memory PRIVATE SuiteSparse::SuiteSparseConfig ) set_target_properties ( mongoose_test_memory PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH} ) add_test ( NAME Mongoose_Memory_Test COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Tests/runTests -min 1 -max 15 -t memory ) - if ( WIN32 AND BUILD_SHARED_LIBS ) - set_tests_properties ( Mongoose_Memory_Test PROPERTIES - ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$" ) - endif ( ) - # Performance Test add_executable ( mongoose_test_performance Tests/Mongoose_Test_Performance.cpp Tests/Mongoose_Test_Performance_exe.cpp ) - if ( BUILD_STATIC_LIBS ) - target_link_libraries ( mongoose_test_performance Mongoose_static ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( mongoose_test_performance PRIVATE Mongoose ) else ( ) - target_link_libraries ( mongoose_test_performance Mongoose ) - endif ( ) - if ( TARGET SuiteSparse::SuiteSparseConfig_static ) - target_link_libraries ( mongoose_test_performance SuiteSparse::SuiteSparseConfig_static ) - else ( ) - target_link_libraries ( mongoose_test_performance SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( mongoose_test_performance PRIVATE Mongoose_static ) endif ( ) + target_link_libraries ( mongoose_test_performance PRIVATE SuiteSparse::SuiteSparseConfig ) set_target_properties ( mongoose_test_performance PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH} ) @@ -383,8 +359,12 @@ if ( BUILD_TESTING ) COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Tests/runTests -t performance -i 21 39 1557 1562 353 2468 1470 1380 505 182 201 2331 760 1389 2401 2420 242 250 1530 1533 -p ) if ( WIN32 AND BUILD_SHARED_LIBS ) - set_tests_properties ( Mongoose_Performance_Test Mongoose_Performance_Test_2 PROPERTIES - ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$" ) + set_tests_properties ( Mongoose_IO_Test + Mongoose_Edge_Separator_Test Mongoose_Edge_Separator_Test_2 Mongoose_Weighted_Edge_Separator_Test Mongoose_Target_Split_Test + Mongoose_Memory_Test + Mongoose_Performance_Test Mongoose_Performance_Test_2 + PROPERTIES + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$;PATH=path_list_prepend:$" ) endif ( ) endif ( ) @@ -392,22 +372,24 @@ if ( BUILD_TESTING ) add_executable ( mongoose_test_reference Tests/Mongoose_Test_Reference.cpp Tests/Mongoose_Test_Reference_exe.cpp ) - if ( BUILD_STATIC_LIBS ) - target_link_libraries ( mongoose_test_reference Mongoose_static ) - else ( ) - target_link_libraries ( mongoose_test_reference Mongoose ) - endif ( ) - if ( TARGET SuiteSparse::SuiteSparseConfig_static ) - target_link_libraries ( mongoose_test_reference SuiteSparse::SuiteSparseConfig_static ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( mongoose_test_reference PRIVATE Mongoose ) else ( ) - target_link_libraries ( mongoose_test_reference SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( mongoose_test_reference PRIVATE Mongoose_static ) endif ( ) + target_link_libraries ( mongoose_test_reference PRIVATE SuiteSparse::SuiteSparseConfig ) set_target_properties ( mongoose_test_reference PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH} ) + # FIXME: Is there a test that is using this executable? # Unit Tests add_executable ( mongoose_unit_test_io Tests/Mongoose_UnitTest_IO_exe.cpp ) - target_link_libraries ( mongoose_unit_test_io Mongoose_static_dbg ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( mongoose_unit_test_io PRIVATE Mongoose ) + else ( ) + target_link_libraries ( mongoose_unit_test_io PRIVATE Mongoose_static ) + endif ( ) + target_link_libraries ( mongoose_unit_test_io PRIVATE SuiteSparse::SuiteSparseConfig ) set_target_properties ( mongoose_unit_test_io PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH} ) add_test ( NAME Mongoose_Unit_Test_IO COMMAND ${TESTING_OUTPUT_PATH}/mongoose_unit_test_io @@ -415,7 +397,12 @@ if ( BUILD_TESTING ) add_executable ( mongoose_unit_test_graph Tests/Mongoose_UnitTest_Graph_exe.cpp ) - target_link_libraries ( mongoose_unit_test_graph Mongoose_static_dbg ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( mongoose_unit_test_graph PRIVATE Mongoose ) + else ( ) + target_link_libraries ( mongoose_unit_test_graph PRIVATE Mongoose_static ) + endif ( ) + target_link_libraries ( mongoose_unit_test_graph PRIVATE SuiteSparse::SuiteSparseConfig ) set_target_properties ( mongoose_unit_test_graph PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH} ) add_test ( NAME Mongoose_Unit_Test_Graph COMMAND ${TESTING_OUTPUT_PATH}/mongoose_unit_test_graph @@ -423,7 +410,12 @@ if ( BUILD_TESTING ) add_executable ( mongoose_unit_test_edgesep Tests/Mongoose_UnitTest_EdgeSep_exe.cpp ) - target_link_libraries ( mongoose_unit_test_edgesep Mongoose_static_dbg ) + if ( BUILD_SHARED_LIBS ) + target_link_libraries ( mongoose_unit_test_edgesep PRIVATE Mongoose ) + else ( ) + target_link_libraries ( mongoose_unit_test_edgesep PRIVATE Mongoose_static ) + endif ( ) + target_link_libraries ( mongoose_unit_test_edgesep PRIVATE SuiteSparse::SuiteSparseConfig ) set_target_properties ( mongoose_unit_test_edgesep PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH} ) add_test ( NAME Mongoose_Unit_Test_EdgeSep COMMAND ${TESTING_OUTPUT_PATH}/mongoose_unit_test_edgesep @@ -431,7 +423,7 @@ if ( BUILD_TESTING ) if ( WIN32 AND BUILD_SHARED_LIBS ) set_tests_properties ( Mongoose_Unit_Test_IO Mongoose_Unit_Test_Graph Mongoose_Unit_Test_EdgeSep PROPERTIES - ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$" ) + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$;PATH=path_list_prepend:$" ) endif ( ) if ( $ENV{MONGOOSE_COVERAGE} ) @@ -485,24 +477,32 @@ if ( BUILD_TESTING ) # using Visual Studio C++ endif () - set_target_properties ( Mongoose_static_dbg PROPERTIES - COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" - LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) + if ( MONGOOSE_COVERAGE ) + if ( BUILD_SHARED_LIBS ) + set_target_properties ( Mongoose PROPERTIES + COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" + LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) + else ( ) + set_target_properties ( Mongoose_static PROPERTIES + COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" + LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) + endif ( ) - # Add debug compile/linker flags - if ( Python_Interpreter_FOUND ) - set_target_properties ( mongoose_test_io mongoose_test_memory - mongoose_test_edgesep PROPERTIES + # Add debug compile/linker flags + if ( Python_Interpreter_FOUND ) + set_target_properties ( mongoose_test_io mongoose_test_memory + mongoose_test_edgesep PROPERTIES + COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" + LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) + endif ( ) + + set_target_properties ( mongoose_unit_test_io mongoose_unit_test_graph + mongoose_unit_test_edgesep PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) - endif ( ) - - set_target_properties ( mongoose_unit_test_io mongoose_unit_test_graph - mongoose_unit_test_edgesep PROPERTIES - COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" - LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) - set ( CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1 ) # Necessary for gcov - prevents file.cpp.gcda instead of file.gcda + set ( CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1 ) # Necessary for gcov - prevents file.cpp.gcda instead of file.gcda + endif ( ) # if ( BUILD_STATIC_LIBS ) # add_custom_command ( TARGET Mongoose_static diff --git a/Mongoose/Doc/Mongoose_UserGuide.pdf b/Mongoose/Doc/Mongoose_UserGuide.pdf index 5d78822212..6ce32ec065 100644 Binary files a/Mongoose/Doc/Mongoose_UserGuide.pdf and b/Mongoose/Doc/Mongoose_UserGuide.pdf differ diff --git a/Mongoose/Doc/title-info.tex b/Mongoose/Doc/title-info.tex index 11761e9bce..17a35c4175 100644 --- a/Mongoose/Doc/title-info.tex +++ b/Mongoose/Doc/title-info.tex @@ -1,3 +1,3 @@ -\title{Mongoose User Guide, Version 3.3.0} +\title{Mongoose User Guide, Version 3.3.1} \author{Scott Kolodziej, Nuri Yeralan, Tim Davis, William W. Hager} -\date{Dec 30, 2023} +\date{Jan 10, 2024} diff --git a/Mongoose/Executable/mongoose.cpp b/Mongoose/Executable/mongoose.cpp index 2406a473a7..8bde663edf 100644 --- a/Mongoose/Executable/mongoose.cpp +++ b/Mongoose/Executable/mongoose.cpp @@ -10,11 +10,11 @@ //------------------------------------------------------------------------------ +#include "Mongoose.hpp" // #include "Mongoose_Internal.hpp" // #include "Mongoose_EdgeCut.hpp" // #include "Mongoose_IO.hpp" #include "Mongoose_Logger.hpp" -#include "Mongoose.hpp" #include diff --git a/Mongoose/Include/Mongoose.hpp b/Mongoose/Include/Mongoose.hpp index 148da25fb6..7e87dc8fb8 100644 --- a/Mongoose/Include/Mongoose.hpp +++ b/Mongoose/Include/Mongoose.hpp @@ -20,12 +20,28 @@ // Configuration information from CMake #define Mongoose_VERSION_MAJOR 3 #define Mongoose_VERSION_MINOR 3 -#define Mongoose_VERSION_PATCH 0 -#define Mongoose_DATE "Dec 30, 2023" +#define Mongoose_VERSION_PATCH 1 +#define Mongoose_DATE "Jan 10, 2024" -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "Mongoose 3.3. requires SuiteSparse_config 7.4.0 or later" +#define Mongoose__VERSION SUITESPARSE__VERCODE(3,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "Mongoose 3.3.1 requires SuiteSparse_config 7.5.0 or later" +#endif + +#if defined (_MSC_VER) && ! defined (__INTEL_COMPILER) + #if defined (MONGOOSE_STATIC) + #define MONGOOSE_API + #else + #if defined (MONGOOSE_BUILDING) + #define MONGOOSE_API __declspec ( dllexport ) + #else + #define MONGOOSE_API __declspec ( dllimport ) + #endif + #endif +#else + // for other compilers + #define MONGOOSE_API #endif namespace Mongoose diff --git a/Mongoose/Include/Mongoose_Internal.hpp b/Mongoose/Include/Mongoose_Internal.hpp index e7ff9a696b..0012d1449b 100644 --- a/Mongoose/Include/Mongoose_Internal.hpp +++ b/Mongoose/Include/Mongoose_Internal.hpp @@ -36,14 +36,33 @@ #error "Mongoose requires SuiteSparse_config 7.4.0 or later" #endif +#ifndef MAX_INT +#define MAX_INT INT64_MAX +#endif + +#ifndef MONGOOSE_HPP +// avoid collision with symbols that are declared in Mongoose.hpp + +#if defined (_MSC_VER) && ! defined (__INTEL_COMPILER) + #if defined (MONGOOSE_STATIC) + #define MONGOOSE_API + #else + #if defined (MONGOOSE_BUILDING) + #define MONGOOSE_API __declspec ( dllexport ) + #else + #define MONGOOSE_API __declspec ( dllimport ) + #endif + #endif +#else + // for other compilers + #define MONGOOSE_API +#endif + namespace Mongoose { /* Type definitions */ typedef int64_t Int; -#ifndef MAX_INT -#define MAX_INT INT64_MAX -#endif /* Enumerations */ enum MatchingStrategy @@ -70,5 +89,6 @@ enum MatchType }; } // end namespace Mongoose +#endif #endif diff --git a/Mongoose/Include/Mongoose_Logger.hpp b/Mongoose/Include/Mongoose_Logger.hpp index 37df90a08c..1efd7cc7ae 100644 --- a/Mongoose/Include/Mongoose_Logger.hpp +++ b/Mongoose/Include/Mongoose_Logger.hpp @@ -32,6 +32,8 @@ #error "Mongoose requires SuiteSparse_config 7.4.0 or later" #endif +#include "Mongoose_Internal.hpp" + // Default Logging Levels #ifndef LOG_ERROR #define LOG_ERROR 1 @@ -101,10 +103,10 @@ typedef enum TimingType class Logger { private: - static int debugLevel; - static bool timingOn; - static double clocks[6]; - static float times[6]; + MONGOOSE_API static int debugLevel; + MONGOOSE_API static bool timingOn; + MONGOOSE_API static double clocks[6]; + MONGOOSE_API static float times[6]; public: static inline void tic(TimingType timingType); diff --git a/Mongoose/Version/Mongoose.hpp.in b/Mongoose/Version/Mongoose.hpp.in index 378a52d854..3956f03839 100644 --- a/Mongoose/Version/Mongoose.hpp.in +++ b/Mongoose/Version/Mongoose.hpp.in @@ -23,9 +23,25 @@ #define Mongoose_VERSION_PATCH @Mongoose_VERSION_PATCH@ #define Mongoose_DATE "@Mongoose_DATE@" -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "Mongoose @Mongoose_VERSION_MAJOR@.@Mongoose_VERSION_MINOR@.@Mongoose_VERSION_SUB@ requires SuiteSparse_config 7.4.0 or later" +#define Mongoose__VERSION SUITESPARSE__VERCODE(@Mongoose_VERSION_MAJOR@,@Mongoose_VERSION_MINOR@,@Mongoose_VERSION_PATCH@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "Mongoose @Mongoose_VERSION_MAJOR@.@Mongoose_VERSION_MINOR@.@Mongoose_VERSION_PATCH@ requires SuiteSparse_config 7.5.0 or later" +#endif + +#if defined (_MSC_VER) && ! defined (__INTEL_COMPILER) + #if defined (MONGOOSE_STATIC) + #define MONGOOSE_API + #else + #if defined (MONGOOSE_BUILDING) + #define MONGOOSE_API __declspec ( dllexport ) + #else + #define MONGOOSE_API __declspec ( dllimport ) + #endif + #endif +#else + // for other compilers + #define MONGOOSE_API #endif namespace Mongoose diff --git a/Mongoose/codemeta.json b/Mongoose/codemeta.json index 4513d6af5f..8a689ede68 100644 --- a/Mongoose/codemeta.json +++ b/Mongoose/codemeta.json @@ -7,8 +7,8 @@ "codeRepository": "https://github.com/ScottKolo/Mongoose", "issueTracker": "https://github.com/ScottKolo/Mongoose/issues", "license": "https://spdx.org/licenses/GPL-3.0-only.html", - "version": "3.3.0", - "softwareVersion": "3.3.0", + "version": "3.3.1", + "softwareVersion": "3.3.1", "author": [ { "@type": "Person", @@ -47,7 +47,7 @@ }, "contIntegration": "https://travis-ci.com/ScottKolo/Mongoose", "developmentStatus": "active", - "downloadUrl": "https://github.com/ScottKolo/Mongoose/archive/v3.3.0.zip", + "downloadUrl": "https://github.com/ScottKolo/Mongoose/archive/v3.3.1.zip", "funding":"Office of Naval Research grant N00014-11-1-0068", "funding":"Office of Naval Research grant N00014-15-1-2048", "funding":"Office of Naval Research grant N00014-18-1-2100", @@ -66,7 +66,7 @@ ], "dateCreated":"2018-04-09", "datePublished":"2018-05-25", - "dateModified":"2023-12-30", + "dateModified":"2024-01-10", "programmingLanguage": "C++", "programmingLanguage": "MATLAB" } diff --git a/ParU/CMakeLists.txt b/ParU/CMakeLists.txt index f6c10f87fc..183066c0ce 100644 --- a/ParU/CMakeLists.txt +++ b/ParU/CMakeLists.txt @@ -13,10 +13,10 @@ # cmake 3.22 is required to find the BLAS in SuiteSparse_config cmake_minimum_required ( VERSION 3.22 ) -set ( PARU_DATE "Dec 30, 2023" ) +set ( PARU_DATE "Jan 10, 2024" ) set ( PARU_VERSION_MAJOR 0 CACHE STRING "" FORCE ) set ( PARU_VERSION_MINOR 1 CACHE STRING "" FORCE ) -set ( PARU_VERSION_UPDATE 0 CACHE STRING "" FORCE ) +set ( PARU_VERSION_UPDATE 1 CACHE STRING "" FORCE ) message ( STATUS "Building PARU version: v" ${PARU_VERSION_MAJOR}. @@ -61,7 +61,11 @@ endif ( ) if ( PARU_USE_OPENMP ) # OpenMP 4.5 or later is required - find_package ( OpenMP GLOBAL ) + if ( CMAKE_VERSION VERSION_LESS 3.24 ) + find_package ( OpenMP COMPONENTS C CXX ) + else ( ) + find_package ( OpenMP COMPONENTS C CXX GLOBAL ) + endif ( ) if ( OpenMP_CXX_FOUND AND OpenMP_C_FOUND ) set ( PARU_HAS_OPENMP ON ) if (( OpenMP_CXX_VERSION VERSION_LESS 4.5 ) OR @@ -96,16 +100,16 @@ endif ( ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) - find_package ( CHOLMOD 5.1.0 + find_package ( CHOLMOD 5.1.1 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) if ( NOT CHOLMOD_FOUND ) - find_package ( CHOLMOD 5.1.0 REQUIRED ) + find_package ( CHOLMOD 5.1.1 REQUIRED ) endif ( ) find_package ( UMFPACK 6.3.0 diff --git a/ParU/Config/ParUConfig.cmake.in b/ParU/Config/ParUConfig.cmake.in index 9aa2f94c5e..202bfc3edf 100644 --- a/ParU/Config/ParUConfig.cmake.in +++ b/ParU/Config/ParUConfig.cmake.in @@ -88,6 +88,14 @@ if ( NOT SuiteSparse_config_FOUND OR NOT CHOLMOD_FOUND OR NOT UMFPACK_FOUND ) set ( _dependencies_found OFF ) endif ( ) +# Look for OpenMP +if ( @PARU_HAS_OPENMP@ AND NOT OpenMP_CXX_FOUND ) + find_dependency ( OpenMP COMPONENTS CXX ) + if ( NOT OpenMP_CXX_FOUND ) + set ( _dependencies_found OFF ) + endif ( ) +endif ( ) + if ( NOT _dependencies_found ) set ( ParU_FOUND OFF ) return ( ) @@ -96,6 +104,31 @@ endif ( ) # Import target include ( ${CMAKE_CURRENT_LIST_DIR}/ParUTargets.cmake ) +if ( @PARU_HAS_OPENMP@ ) + if ( TARGET SuiteSparse::ParU ) + get_property ( _paru_aliased TARGET SuiteSparse::ParU + PROPERTY ALIASED_TARGET ) + if ( "${_paru_aliased}" STREQUAL "" ) + target_include_directories ( SuiteSparse::ParU SYSTEM AFTER INTERFACE + "$" ) + else ( ) + target_include_directories ( ${_paru_aliased} SYSTEM AFTER INTERFACE + "$" ) + endif ( ) + endif ( ) + if ( TARGET SuiteSparse::ParU_static ) + get_property ( _paru_aliased TARGET SuiteSparse::ParU_static + PROPERTY ALIASED_TARGET ) + if ( "${_paru_aliased}" STREQUAL "" ) + target_include_directories ( SuiteSparse::ParU_static SYSTEM AFTER INTERFACE + "$" ) + else ( ) + target_include_directories ( ${_paru_aliased} SYSTEM AFTER INTERFACE + "$" ) + endif ( ) + endif ( ) +endif ( ) + # The following is only for backward compatibility with FindParU. set ( _target_shared SuiteSparse::ParU ) diff --git a/ParU/Config/ParU_definitions.h.in b/ParU/Config/ParU_definitions.h.in index 173c60e196..7a6c69f2ae 100644 --- a/ParU/Config/ParU_definitions.h.in +++ b/ParU/Config/ParU_definitions.h.in @@ -30,17 +30,20 @@ typedef enum ParU_Ret #define PARU_VERSION_MINOR @PARU_VERSION_MINOR@ #define PARU_VERSION_UPDATE @PARU_VERSION_UPDATE@ -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "ParU @PARU_VERSION_MAJOR@.@PARU_VERSION_MINOR@.@PARU_VERSION_SUB@ requires SuiteSparse_config 7.4.0 or later" +#define PARU__VERSION SUITESPARSE__VERCODE(@PARU_VERSION_MAJOR@,@PARU_VERSION_MINOR@,@PARU_VERSION_UPDATE@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "ParU @PARU_VERSION_MAJOR@.@PARU_VERSION_MINOR@.@PARU_VERSION_UPDATE@ requires SuiteSparse_config 7.5.0 or later" #endif -#if UMFPACK_VER < SUITESPARSE_VER_CODE(6,3) -#error "ParU @PARU_VERSION_MAJOR@.@PARU_VERSION_MINOR@.@PARU_VERSION_SUB@ requires UMFPACK 6.3.0 or later" +#if !defined (UMFPACK__VERSION) || \ + (UMFPACK__VERSION < SUITESPARSE__VERCODE(6,3,1)) +#error "ParU @PARU_VERSION_MAJOR@.@PARU_VERSION_MINOR@.@PARU_VERSION_UPDATE@ requires UMFPACK 6.3.1 or later" #endif -#if CHOLMOD_VERSION < SUITESPARSE_VER_CODE(5,1) -#error "ParU @PARU_VERSION_MAJOR@.@PARU_VERSION_MINOR@.@PARU_VERSION_SUB@ requires CHOLMOD 5.1.0 or later" +#if !defined (CHOLMOD__VERSION) || \ + (CHOLMOD__VERSION < SUITESPARSE__VERCODE(5,1,1)) +#error "ParU @PARU_VERSION_MAJOR@.@PARU_VERSION_MINOR@.@PARU_VERSION_UPDATE@ requires CHOLMOD 5.1.1 or later" #endif // the same values as UMFPACK_STRATEGY defined in UMFPACK/Include/umfpack.h diff --git a/ParU/Demo/paru_demo.cpp b/ParU/Demo/paru_demo.cpp index 9f307aae17..373ecacc23 100644 --- a/ParU/Demo/paru_demo.cpp +++ b/ParU/Demo/paru_demo.cpp @@ -11,7 +11,10 @@ * * @author Aznaveh * */ -#include +#include +#include +#include +#include #include #include "ParU.hpp" @@ -32,19 +35,19 @@ int main(int argc, char **argv) A = (cholmod_sparse *)cholmod_l_read_matrix(stdin, 1, &mtype, cc); if (A == NULL) { - printf("ParU: input matrix is invalid\n"); + std::cout << "ParU: input matrix is invalid" << std::endl; exit(1); } if (mtype != CHOLMOD_SPARSE) { - printf("ParU: input matrix must be sparse\n"); + std::cout << "ParU: input matrix must be sparse" << std::endl; exit(1); } if (A->xtype != CHOLMOD_REAL) { - printf("ParU: input matrix must be real\n"); + std::cout << "ParU: input matrix must be real" << std::endl; exit(1); } @@ -52,9 +55,9 @@ int main(int argc, char **argv) int ver[3]; char date[128]; ParU_Version(ver, date); - printf("================= ParU %d.%d.%d ==================================", - ver[0], ver[1], ver[2]); - printf(" %s\n", date); + std::cout << "================= ParU " + << ver[0] << "." << ver[1] << "." << ver[2] + << " ================================== " << date << std::endl; double my_start_time = omp_get_wtime(); @@ -67,7 +70,7 @@ int main(int argc, char **argv) // Control.umfpack_default_singleton = 0; // Control.paru_max_threads = 6; Control.umfpack_ordering = UMFPACK_ORDERING_METIS_GUARD; - printf ("\n--------- ParU_Analyze:\n") ; + std::cout << "\n--------- ParU_Analyze:\n"; info = ParU_Analyze(A, &Sym, &Control); double my_time_analyze = omp_get_wtime() - my_start_time; if (info != PARU_SUCCESS) @@ -76,20 +79,26 @@ int main(int argc, char **argv) cholmod_l_finish(cc); return info; } - printf("In: %ldx%ld nnz = %ld \n", Sym->m, Sym->n, Sym->anz); - printf("ParU: Symbolic factorization is done in %lfs!\n", my_time_analyze); + std::cout << "In: " << Sym->m << "x" << Sym->n + << " nnz = " << Sym->anz << std::endl; + std::cout << std::scientific << std::setprecision(1) + << "ParU: Symbolic factorization is done in " << my_time_analyze << "s!\n"; ParU_Numeric *Num; - printf ("\n--------- ParU_Factorize:\n") ; + std::cout << "\n--------- ParU_Factorize:" << std::endl; double my_start_time_fac = omp_get_wtime(); info = ParU_Factorize(A, Sym, &Num, &Control); double my_time_fac = omp_get_wtime() - my_start_time_fac; if (info != PARU_SUCCESS) { - printf("ParU: factorization was NOT successfull in %lf seconds!", - my_time_fac); - if (info == PARU_OUT_OF_MEMORY) printf("\nOut of memory\n"); - if (info == PARU_INVALID) printf("\nInvalid!\n"); - if (info == PARU_SINGULAR) printf("\nSingular!\n"); + std::cout << std::scientific << std::setprecision(1) + << "ParU: factorization was NOT successful in " << my_time_fac + << " seconds!\n"; + if (info == PARU_OUT_OF_MEMORY) + std::cout << "Out of memory\n"; + if (info == PARU_INVALID) + std::cout << "Invalid!\n"; + if (info == PARU_SINGULAR) + std::cout << "Singular!\n"; cholmod_l_free_sparse(&A, cc); cholmod_l_finish(cc); ParU_Freesym(&Sym, &Control); @@ -97,8 +106,9 @@ int main(int argc, char **argv) } else { - printf("ParU: factorization was successfull in %lf seconds.\n", - my_time_fac); + std::cout << std::scientific << std::setprecision(1) + << "ParU: factorization was successful in " << my_time_fac + << " seconds.\n"; } //~~~~~~~~~~~~~~~~~~~Test the results ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -110,12 +120,12 @@ int main(int argc, char **argv) double *b = (double *)malloc(m * sizeof(double)); double *xx = (double *)malloc(m * sizeof(double)); for (int64_t i = 0; i < m; ++i) b[i] = i + 1; - printf ("\n--------- ParU_Solve:\n") ; + std::cout << "\n--------- ParU_Solve:\n"; double my_solve_time_start = omp_get_wtime(); info = ParU_Solve(Sym, Num, b, xx, &Control); if (info != PARU_SUCCESS) { - printf("ParU: Solve has a problem.\n"); + std::cout << "ParU: Solve has a problem.\n"; free(b); free(xx); cholmod_l_free_sparse(&A, cc); @@ -125,22 +135,24 @@ int main(int argc, char **argv) } my_solve_time = omp_get_wtime() - my_solve_time_start; my_time = omp_get_wtime() - my_start_time; - printf("Solve time is %lf seconds.\n", my_solve_time); + std::cout << std::defaultfloat << std::setprecision(1) + << "Solve time is " << my_solve_time << " seconds.\n"; // printing out x #if 0 - printf("x = ["); - for (int64_t i = 0; i < m; ++i) - printf (" %.2lf, ", xx[i]); - printf("]\n"); + std::cout << "x = ["; + std::cout << std::defaultfloat << std::setprecision(22); + for (int64_t i = 0; i < m; ++i) + std::cout << " " << xx[i] << "', "; + std::cout << "]\n"; #endif double resid, anorm, xnorm; - printf ("\n--------- ParU_Residual:\n") ; + std::cout << "\n--------- ParU_Residual:\n"; info = ParU_Residual(A, xx, b, m, resid, anorm, xnorm, &Control); if (info != PARU_SUCCESS) { - printf("ParU: Residual has a problem.\n"); + std::cout << "ParU: Residual has a problem.\n"; free(b); free(xx); cholmod_l_free_sparse(&A, cc); @@ -150,8 +162,10 @@ int main(int argc, char **argv) } double rresid = (anorm == 0 || xnorm == 0 ) ? 0 : (resid/(anorm*xnorm)); - printf( "Relative residual is |%.2e|, anorm is %.2e, xnorm is %.2e " - " and rcond is %.2e.\n", rresid, anorm, xnorm, Num->rcond); + std::cout << std::scientific << std::setprecision(2) + << "Relative residual is |" << rresid << "|, anorm is " << anorm + << ", xnorm is " << xnorm << " and rcond is " << Num->rcond << "." + << std::endl; free(b); free(xx); @@ -162,11 +176,11 @@ int main(int argc, char **argv) for (int64_t j = 0; j < nrhs; ++j) B[j * m + i] = (double)(i + j + 1); - printf ("\n--------- ParU_Solve:\n") ; + std::cout << "\n--------- ParU_Solve:\n"; info = ParU_Solve(Sym, Num, nrhs, B, X, &Control); if (info != PARU_SUCCESS) { - printf("ParU: mRhs Solve has a problem.\n"); + std::cout << "ParU: mRhs Solve has a problem.\n"; free(B); free(X); cholmod_l_free_sparse(&A, cc); @@ -174,11 +188,11 @@ int main(int argc, char **argv) ParU_Freesym(&Sym, &Control); return info; } - printf ("\n--------- ParU_Residual:\n") ; + std::cout << "\n--------- ParU_Residual:\n"; info = ParU_Residual(A, X, B, m, nrhs, resid, anorm, xnorm, &Control); if (info != PARU_SUCCESS) { - printf("ParU: mRhs Residual has a problem.\n"); + std::cout << "ParU: mRhs Residual has a problem.\n"; free(B); free(X); cholmod_l_free_sparse(&A, cc); @@ -188,8 +202,9 @@ int main(int argc, char **argv) } rresid = (anorm == 0 || xnorm == 0 ) ? 0 : (resid/(anorm*xnorm)); - printf("Multiple right hand side: relative residual is |%.2e|.\n", - rresid); + std::cout << std::scientific << std::setprecision(2) + << "Multiple right hand side: relative residual is |" + << rresid << "|." << std::endl; free(B); free(X); @@ -234,7 +249,7 @@ int main(int argc, char **argv) { umfpack_dl_report_info(umf_Control, Info); umfpack_dl_report_status(umf_Control, status); - printf("umfpack_dl_symbolic failed\n"); + std::cout << "umfpack_dl_symbolic failed\n"; exit(0); } double umf_symbolic = omp_get_wtime() - umf_start_time; @@ -248,7 +263,7 @@ int main(int argc, char **argv) { umfpack_dl_report_info(umf_Control, Info); umfpack_dl_report_status(umf_Control, status); - printf("umfpack_dl_numeric failed\n"); + std::cout << "umfpack_dl_numeric failed\n"; } double umf_time_fac = omp_get_wtime() - umf_fac_start; @@ -266,9 +281,10 @@ int main(int argc, char **argv) info = ParU_Residual(A, x, b, m, umf_resid, umf_anorm, umf_xnorm, &Control); double umf_rresid = (umf_anorm == 0 || umf_xnorm == 0 ) ? 0 : (umf_resid/(umf_anorm*umf_xnorm)); - printf( "UMFPACK relative residual is |%.2e|, anorm is %.2e, " - " xnorm is %.2e and rcond is %.2e.\n", - umf_rresid, umf_anorm, umf_xnorm, Num->rcond); + std::cout << std::scientific << std::setprecision(2) + << "UMFPACK relative residual is |" << umf_rresid << "|, anorm is " + << umf_anorm << ", xnorm is " << umf_xnorm << " and rcond is " + << Num->rcond << "." << std::endl; free(x); free(b); @@ -286,15 +302,17 @@ int main(int argc, char **argv) res_file = fopen(res_name, "a"); if (res_file == NULL) { - printf("Par: error in making %s to write the results!\n", res_name); + std::cout << "Par: error in making " << res_name << " to write the results!\n"; } - fprintf(res_file, "%ld %ld %lf %lf %lf %lf %lf %lf %lf %lf\n", Sym->m, - Sym->anz, my_time_analyze, my_time_fac, my_solve_time, my_time, + fprintf(res_file, "%" PRId64" %" PRId64 " %lf %lf %lf %lf %lf %lf %lf %lf\n", + Sym->m, Sym->anz, my_time_analyze, my_time_fac, my_solve_time, my_time, umf_symbolic, umf_time_fac, umf_solve_time, umf_time); fclose(res_file); } - printf("my_time = %lf umf_time=%lf umf_solv_t = %lf ratio = %lf\n", my_time, - umf_time, umf_solve_time, my_time / umf_time); + std::cout << std::scientific << std::setprecision(1) + << "my_time = " << my_time << " umf_time = " << umf_time + << " umf_solv_t = " << umf_solve_time << " ratio = " + << my_time / umf_time << std::endl; #endif // writing to a file //~~~~~~~~~~~~~~~~~~~Free Everything~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/ParU/Demo/paru_democ.c b/ParU/Demo/paru_democ.c index 1cd88cbf8a..f5607c55a7 100644 --- a/ParU/Demo/paru_democ.c +++ b/ParU/Demo/paru_democ.c @@ -11,6 +11,7 @@ * * @author Aznaveh * */ +#include #include #include @@ -77,7 +78,7 @@ int main(int argc, char **argv) cholmod_l_finish(cc); return info; } - printf("In: %ldx%ld nnz = %ld \n", Sym->m, Sym->n, Sym->anz); + printf("In: %" PRId64 "x%" PRId64 " nnz = %" PRId64 " \n", Sym->m, Sym->n, Sym->anz); printf("ParU: Symbolic factorization is done in %lfs!\n", my_time_analyze); ParU_C_Numeric *Num; printf ("\n--------- ParU_C_Factorize:\n") ; @@ -86,7 +87,7 @@ int main(int argc, char **argv) double my_time_fac = omp_get_wtime() - my_start_time_fac; if (info != PARU_SUCCESS) { - printf("ParU: factorization was NOT successfull in %lf seconds!", + printf("ParU: factorization was NOT successful in %lf seconds!", my_time_fac); if (info == PARU_OUT_OF_MEMORY) printf("\nOut of memory\n"); if (info == PARU_INVALID) printf("\nInvalid!\n"); @@ -98,7 +99,7 @@ int main(int argc, char **argv) } else { - printf("ParU: factorization was successfull in %lf seconds.\n", + printf("ParU: factorization was successful in %lf seconds.\n", my_time_fac); } diff --git a/ParU/Demo/paru_simple.cpp b/ParU/Demo/paru_simple.cpp index 2cdc46864e..060fedffb9 100644 --- a/ParU/Demo/paru_simple.cpp +++ b/ParU/Demo/paru_simple.cpp @@ -10,7 +10,10 @@ * @brief a simple test to show how to use ParU in C++ * @author Aznaveh * */ -#include +#include +#include +#include +#include #include "ParU.hpp" int main(int argc, char **argv) @@ -26,24 +29,28 @@ int main(int argc, char **argv) // A = mread (stdin) ; read in the sparse matrix A A = (cholmod_sparse *)cholmod_l_read_matrix(stdin, 1, &mtype, cc); //~~~~~~~~~~~~~~~~~~~Starting computation~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - printf("================= ParU, a simple demo: ========================\n"); + std::cout << "================= ParU, a simple demo: ========================\n"; ParU_Control Control; ParU_Ret info; info = ParU_Analyze(A, &Sym, &Control); - printf("Input matrix is %ldx%ld nnz = %ld \n", Sym->m, Sym->n, Sym->anz); + std::cout << "Input matrix is " << Sym->m << "x" << Sym->n + << " nnz = " << Sym->anz << std::endl; ParU_Numeric *Num; info = ParU_Factorize(A, Sym, &Num, &Control); if (info != PARU_SUCCESS) { - printf("ParU: factorization was NOT successfull."); - if (info == PARU_OUT_OF_MEMORY) printf("\nOut of memory\n"); - if (info == PARU_INVALID) printf("\nInvalid!\n"); - if (info == PARU_SINGULAR) printf("\nSingular!\n"); + std::cout << "ParU: factorization was NOT successful.\n"; + if (info == PARU_OUT_OF_MEMORY) + std::cout << "Out of memory\n"; + if (info == PARU_INVALID) + std::cout << "Invalid!\n"; + if (info == PARU_SINGULAR) + std::cout << "Singular!\n"; } else { - printf("ParU: factorization was successfull.\n"); + std::cout << "ParU: factorization was successful." << std::endl; } //~~~~~~~~~~~~~~~~~~~ Computing Ax = b ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -58,9 +65,10 @@ int main(int argc, char **argv) double resid, anorm, xnorm; info = ParU_Residual(A, xx, b, m, resid, anorm, xnorm, &Control); double rresid = (anorm == 0 || xnorm == 0 ) ? 0 : (resid/(anorm*xnorm)); - printf( - "Relative residual is |%.2e| anorm is %.2e, xnorm is %.2e" - " and rcond is %.2e.\n", rresid, anorm, xnorm, Num->rcond); + std::cout << std::scientific << std::setprecision(2) + << "Relative residual is |" << rresid << "| anorm is " << anorm + << ", xnorm is " << xnorm << " and rcond is " << Num->rcond << "." + << std::endl; free(b); free(xx); } diff --git a/ParU/Demo/paru_simplec.c b/ParU/Demo/paru_simplec.c index dbe62ff936..5bcca6ab90 100644 --- a/ParU/Demo/paru_simplec.c +++ b/ParU/Demo/paru_simplec.c @@ -10,6 +10,7 @@ * @brief a simple test to show how to use ParU with C interface * @author Aznaveh * */ +#include #include #include "ParU_C.h" @@ -31,20 +32,20 @@ int main(int argc, char **argv) ParU_C_Init_Control(&Control); ParU_Ret info; info = ParU_C_Analyze(A, &Sym, &Control); - printf("Input matrix is %ldx%ld nnz = %ld \n", Sym->m, Sym->n, Sym->anz); + printf("Input matrix is %" PRId64 "x%" PRId64 " nnz = %" PRId64 " \n", Sym->m, Sym->n, Sym->anz); ParU_C_Numeric *Num; info = ParU_C_Factorize(A, Sym, &Num, &Control); if (info != PARU_SUCCESS) { - printf("ParU: factorization was NOT successfull."); + printf("ParU: factorization was NOT successful."); if (info == PARU_OUT_OF_MEMORY) printf("\nOut of memory\n"); if (info == PARU_INVALID) printf("\nInvalid!\n"); if (info == PARU_SINGULAR) printf("\nSingular!\n"); } else { - printf("ParU: factorization was successfull.\n"); + printf("ParU: factorization was successful.\n"); } //~~~~~~~~~~~~~~~~~~~ Computing Ax = b ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/ParU/Doc/ChangeLog b/ParU/Doc/ChangeLog index 372aa249bc..00d9f92088 100644 --- a/ParU/Doc/ChangeLog +++ b/ParU/Doc/ChangeLog @@ -1,3 +1,7 @@ +Jan 10, 2024: version 0.1.1 + + * minor update to build system + Dec 30, 2023: version 0.1.0 * first release: in SuiteSparse 7.4.0 diff --git a/ParU/Doc/Makefile b/ParU/Doc/Makefile index 1047a486c2..0c160b7a70 100644 --- a/ParU/Doc/Makefile +++ b/ParU/Doc/Makefile @@ -13,7 +13,7 @@ paru_user_guide.pdf: paru_user_guide.tex paru_user_guide.bib Makefile paru_versi bibtex paru_user_guide pdflatex --shell-escape paru_user_guide.tex pdflatex --shell-escape paru_user_guide.tex - - $(RM) -r $(PURGE) *.out _minted-paru_* + - $(RM) -r $(PURGE) *.out *.aux *.log *.bbl *.blg _minted-paru_* distclean: purge @@ -21,5 +21,5 @@ clean: - $(RM) -r $(CLEAN) purge: clean - - $(RM) -r $(PURGE) *.out _minted-paru_* + - $(RM) -r $(PURGE) *.out *.aux *.log *.bbl *.blg _minted-paru_* diff --git a/ParU/Doc/paru_user_guide.pdf b/ParU/Doc/paru_user_guide.pdf index 5b04cab087..ba67eea9bd 100644 Binary files a/ParU/Doc/paru_user_guide.pdf and b/ParU/Doc/paru_user_guide.pdf differ diff --git a/ParU/Doc/paru_version.tex b/ParU/Doc/paru_version.tex index f95c501d51..93af16530f 100644 --- a/ParU/Doc/paru_version.tex +++ b/ParU/Doc/paru_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/ParU -\date{VERSION 0.1.0, Dec 30, 2023} +\date{VERSION 0.1.1, Jan 10, 2024} diff --git a/ParU/Include/ParU.hpp b/ParU/Include/ParU.hpp index cbeba4d20e..ab887c3c66 100644 --- a/ParU/Include/ParU.hpp +++ b/ParU/Include/ParU.hpp @@ -245,7 +245,7 @@ struct ParU_Control // ============================================================================= // ParU_Numeric contains all the numeric information that user needs for solving // a system. The factors are saved as a seried of dense matrices. User can check -// the ParU_Ret to see if the factorization is successfull. sizes of +// the ParU_Ret to see if the factorization is successful. sizes of // ParU_Numeric is size of S matrix in Symbolic analysis. struct ParU_Factors { // dense factorized part pointer diff --git a/ParU/Include/ParU_definitions.h b/ParU/Include/ParU_definitions.h index cc2ca2d88c..c19cb31f4d 100644 --- a/ParU/Include/ParU_definitions.h +++ b/ParU/Include/ParU_definitions.h @@ -25,22 +25,25 @@ typedef enum ParU_Ret #define PARU_MEM_CHUNK (1024*1024) -#define PARU_DATE "Dec 30, 2023" +#define PARU_DATE "Jan 10, 2024" #define PARU_VERSION_MAJOR 0 #define PARU_VERSION_MINOR 1 -#define PARU_VERSION_UPDATE 0 +#define PARU_VERSION_UPDATE 1 -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "ParU 0.1. requires SuiteSparse_config 7.4.0 or later" +#define PARU__VERSION SUITESPARSE__VERCODE(0,1,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "ParU 0.1.1 requires SuiteSparse_config 7.5.0 or later" #endif -#if UMFPACK_VER < SUITESPARSE_VER_CODE(6,3) -#error "ParU 0.1. requires UMFPACK 6.3.0 or later" +#if !defined (UMFPACK__VERSION) || \ + (UMFPACK__VERSION < SUITESPARSE__VERCODE(6,3,1)) +#error "ParU 0.1.1 requires UMFPACK 6.3.1 or later" #endif -#if CHOLMOD_VERSION < SUITESPARSE_VER_CODE(5,1) -#error "ParU 0.1. requires CHOLMOD 5.1.0 or later" +#if !defined (CHOLMOD__VERSION) || \ + (CHOLMOD__VERSION < SUITESPARSE__VERCODE(5,1,1)) +#error "ParU 0.1.1 requires CHOLMOD 5.1.1 or later" #endif // the same values as UMFPACK_STRATEGY defined in UMFPACK/Include/umfpack.h diff --git a/ParU/MATLAB/paru_make.m b/ParU/MATLAB/paru_make.m index 6a5350f25d..72f9aec9ea 100644 --- a/ParU/MATLAB/paru_make.m +++ b/ParU/MATLAB/paru_make.m @@ -60,6 +60,11 @@ % use all of CHOLMOD except for the Modify module flags = [flags ' -DNMODIFY -DBLAS64' ] ; +if (ispc) + % MSVC does not define ssize_t + flags = [flags ' -DNO_SSIZE_T'] ; +end + suitesparse_src = { ... '../../SuiteSparse_config/SuiteSparse_config', ... '../../AMD/Source/amd_l1', ... diff --git a/ParU/Source/paru_analyze.cpp b/ParU/Source/paru_analyze.cpp index 1d4d21f0a2..40008244d8 100644 --- a/ParU/Source/paru_analyze.cpp +++ b/ParU/Source/paru_analyze.cpp @@ -947,7 +947,7 @@ ParU_Ret ParU_Analyze(cholmod_sparse *A, ParU_Symbolic **S_handle, // Making Children list and computing the bound sizes if (nf > 0) { - Childp = (int64_t *)paru_calloc((nf + 2), sizeof(int64_t)); + Childp = static_cast(paru_calloc(nf + 2, sizeof(int64_t))); Sym->Childp = Childp; if (Childp == NULL) { @@ -1001,7 +1001,7 @@ ParU_Ret ParU_Analyze(cholmod_sparse *A, ParU_Symbolic **S_handle, #endif if (nf > 0) { - Child = (int64_t *)paru_calloc((nf + 1), sizeof(int64_t)); + Child = static_cast(paru_calloc(nf + 1, sizeof(int64_t))); Sym->Child = Child; if (Child == NULL) { @@ -1012,7 +1012,7 @@ ParU_Ret ParU_Analyze(cholmod_sparse *A, ParU_Symbolic **S_handle, } } // copy of Childp using Work for other places also - Work = (int64_t *)paru_alloc(std::max(m, n) + 2, sizeof(int64_t)); + Work = static_cast(paru_alloc(std::max(m, n) + 2, sizeof(int64_t))); int64_t *cChildp = Work; if (cChildp == NULL) { @@ -1045,9 +1045,9 @@ ParU_Ret ParU_Analyze(cholmod_sparse *A, ParU_Symbolic **S_handle, /* computing the Staircase structures */ /* ---------------------------------------------------------------------- */ - Sp = Sym->Sp = (int64_t *)paru_calloc(m + 1 - n1, sizeof(int64_t)); - Sleft = Sym->Sleft = (int64_t *)paru_alloc(n + 2 - n1, sizeof(int64_t)); - Pinv = (int64_t *)paru_alloc(m + 1, sizeof(int64_t)); + Sp = Sym->Sp = static_cast(paru_calloc(m + 1 - n1, sizeof(int64_t))); + Sleft = Sym->Sleft = static_cast(paru_alloc(n + 2 - n1, sizeof(int64_t))); + Pinv = static_cast(paru_alloc(m + 1, sizeof(int64_t))); if (Sp == NULL || Sleft == NULL || Pinv == NULL) { diff --git a/ParU/Source/paru_c.cpp b/ParU/Source/paru_c.cpp index dc856ed0ef..03b814395a 100644 --- a/ParU/Source/paru_c.cpp +++ b/ParU/Source/paru_c.cpp @@ -102,7 +102,7 @@ ParU_Ret ParU_C_Analyze( ParU_Control Control; paru_cp_control (&Control, Control_C); ParU_C_Symbolic *Sym_C = - (ParU_C_Symbolic *)paru_alloc(1, sizeof(ParU_C_Symbolic)); + static_cast(paru_alloc(1, sizeof(ParU_C_Symbolic))); if (!Sym_C) { return PARU_OUT_OF_MEMORY; @@ -112,7 +112,7 @@ ParU_Ret ParU_C_Analyze( info = ParU_Analyze(A, &Sym, &Control); if (info != PARU_SUCCESS) return info; //To avoid playing with wrong ponters - Sym_C->sym_handle = (void*) Sym; + Sym_C->sym_handle = static_cast(Sym); *Sym_handle_C = Sym_C; Sym_C->m = Sym->m; Sym_C->n = Sym->n; @@ -137,9 +137,9 @@ ParU_Ret ParU_C_Factorize ( { ParU_Control Control; paru_cp_control (&Control, Control_C); - ParU_Symbolic *Sym = (ParU_Symbolic *) Sym_C->sym_handle; + ParU_Symbolic *Sym = static_cast(Sym_C->sym_handle); ParU_C_Numeric *Num_C = - (ParU_C_Numeric *)paru_alloc(1, sizeof(ParU_C_Numeric)); + static_cast(paru_alloc(1, sizeof(ParU_C_Numeric))); if (!Num_C) { return PARU_OUT_OF_MEMORY; @@ -150,7 +150,7 @@ ParU_Ret ParU_C_Factorize ( info = ParU_Factorize(A, Sym, &Num, &Control); if (info != PARU_SUCCESS) return info; - Num_C->num_handle = (void *) Num; + Num_C->num_handle = static_cast(Num); *Num_handle_C = Num_C; Num_C->rcond = Num->rcond; return info; @@ -174,8 +174,9 @@ ParU_Ret ParU_C_Solve_Axx ( { ParU_Control Control; paru_cp_control (&Control, Control_C); - return ParU_Solve ((ParU_Symbolic *) Sym_C->sym_handle, - (ParU_Numeric *) Num_C->num_handle, b, &Control); + return ParU_Solve (static_cast(Sym_C->sym_handle), + static_cast(Num_C->num_handle), + b, &Control); } //-------- Ax = b -------------------------------------------------------------- @@ -189,8 +190,9 @@ ParU_Ret ParU_C_Solve_Axb ( { ParU_Control Control; paru_cp_control (&Control, Control_C); - return ParU_Solve ((ParU_Symbolic *) Sym_C->sym_handle, - (ParU_Numeric *)Num_C->num_handle, b, x, &Control); + return ParU_Solve (static_cast(Sym_C->sym_handle), + static_cast(Num_C->num_handle), + b, x, &Control); } //-------- AX = B (X is overwritten on B, multiple rhs)------------------------ @@ -204,8 +206,9 @@ ParU_Ret ParU_C_Solve_AXX ( { ParU_Control Control; paru_cp_control (&Control, Control_C); - return ParU_Solve ((ParU_Symbolic *) Sym_C->sym_handle, - (ParU_Numeric *)Num_C->num_handle, B, &Control); + return ParU_Solve (static_cast(Sym_C->sym_handle), + static_cast(Num_C->num_handle), + B, &Control); } //-------- AX = B (multiple rhs)----------------------------------------------- @@ -219,8 +222,9 @@ ParU_Ret ParU_C_Solve_AXB ( { ParU_Control Control; paru_cp_control (&Control, Control_C); - return ParU_Solve ((ParU_Symbolic *) Sym_C->sym_handle, - (ParU_Numeric *)Num_C->num_handle, nrhs, B, X, &Control); + return ParU_Solve (static_cast(Sym_C->sym_handle), + static_cast(Num_C->num_handle), + nrhs, B, X, &Control); } //------------------------------------------------------------------------------ @@ -280,7 +284,7 @@ ParU_Ret ParU_C_Freenum ( ParU_Control Control; paru_cp_control (&Control, Control_C); ParU_C_Numeric *Num_C = *Num_handle_C; - ParU_Numeric *Num = (ParU_Numeric *) (Num_C->num_handle); + ParU_Numeric *Num = static_cast(Num_C->num_handle); ParU_Ret info; info = ParU_Freenum(&Num, &Control); paru_free(1, sizeof(ParU_C_Numeric), *Num_handle_C); @@ -293,7 +297,7 @@ ParU_Ret ParU_C_Freesym ( ParU_Control Control; paru_cp_control (&Control, Control_C); ParU_C_Symbolic *Sym_C = *Sym_handle_C; - ParU_Symbolic *Sym = (ParU_Symbolic *)(Sym_C->sym_handle); + ParU_Symbolic *Sym = static_cast(Sym_C->sym_handle); ParU_Ret info; info = ParU_Freesym(&Sym, &Control); paru_free(1, sizeof(ParU_C_Symbolic), *Sym_handle_C); diff --git a/ParU/Source/paru_finalize_perm.cpp b/ParU/Source/paru_finalize_perm.cpp index 5a761e500d..7cc61a5654 100644 --- a/ParU/Source/paru_finalize_perm.cpp +++ b/ParU/Source/paru_finalize_perm.cpp @@ -25,8 +25,8 @@ ParU_Ret paru_finalize_perm(ParU_Symbolic *Sym, ParU_Numeric *Num) int64_t *Ps = NULL; int64_t *Pinit = Sym->Pinit; - Num->Pfin = Pfin = (int64_t *)paru_alloc(m, sizeof(int64_t)); - Num->Ps = Ps = (int64_t *)paru_alloc(m, sizeof(int64_t)); + Num->Pfin = Pfin = static_cast(paru_alloc(m, sizeof(int64_t))); + Num->Ps = Ps = static_cast(paru_alloc(m, sizeof(int64_t))); PRLEVEL(1, ("%% Inside Perm\n")); if (Pfin == NULL || Ps == NULL) diff --git a/ParU/Source/paru_front.cpp b/ParU/Source/paru_front.cpp index 2d44f83c34..239ef3f5ef 100644 --- a/ParU/Source/paru_front.cpp +++ b/ParU/Source/paru_front.cpp @@ -69,7 +69,7 @@ ParU_Ret paru_front(int64_t f, // front need to be assembled int64_t fm = Sym->Fm[f]; /* Upper bound number of rows of F */ PRLEVEL(1, ("%% the size of fm is " LD "\n", fm)); - int64_t *frowList = (int64_t *)paru_alloc(fm, sizeof(int64_t)); + int64_t *frowList = static_cast(paru_alloc(fm, sizeof(int64_t))); if (frowList == NULL) { PRLEVEL(1, ("ParU: out of memory when tried to allocate" @@ -263,7 +263,7 @@ ParU_Ret paru_front(int64_t f, // front need to be assembled if (fn != 0) { PRLEVEL(1, ("%% fp=" LD " fn=" LD " \n", fp, fn)); - fcolList = (int64_t *)paru_calloc(stl_colSet.size(), sizeof(int64_t)); + fcolList = static_cast(paru_calloc(stl_colSet.size(), sizeof(int64_t))); if (fcolList == NULL) { @@ -346,7 +346,7 @@ ParU_Ret paru_front(int64_t f, // front need to be assembled /**** 5 ** assemble U part Row by Row ****/ // consider a parallel calloc - double *uPart = (double *)paru_calloc(fp * colCount, sizeof(double)); + double *uPart = static_cast(paru_calloc(fp * colCount, sizeof(double))); if (uPart == NULL) { PRLEVEL(1, ("ParU: out of memory when tried to" diff --git a/ParU/Source/paru_pivotal.cpp b/ParU/Source/paru_pivotal.cpp index 9550ce54a1..10dd8bb8db 100644 --- a/ParU/Source/paru_pivotal.cpp +++ b/ParU/Source/paru_pivotal.cpp @@ -354,7 +354,7 @@ ParU_Ret paru_pivotal(std::vector &pivotal_elements, if (rowCount != fm) { frowList = - (int64_t *)paru_realloc(rowCount, sizeof(int64_t), frowList, &sz); + static_cast(paru_realloc(rowCount, sizeof(int64_t), frowList, &sz)); } if (sz != (size_t) rowCount) { @@ -364,7 +364,7 @@ ParU_Ret paru_pivotal(std::vector &pivotal_elements, } Num->frowList[f] = frowList ; - double *pivotalFront = (double *)paru_calloc(rowCount * fp, sizeof(double)); + double *pivotalFront = static_cast(paru_calloc(rowCount * fp, sizeof(double))); if (pivotalFront == NULL) { diff --git a/RBio/CMakeLists.txt b/RBio/CMakeLists.txt index e0365e79f1..216aa23945 100644 --- a/RBio/CMakeLists.txt +++ b/RBio/CMakeLists.txt @@ -11,10 +11,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( RBIO_DATE "Dec 30, 2023" ) +set ( RBIO_DATE "Jan 10, 2024" ) set ( RBIO_VERSION_MAJOR 4 CACHE STRING "" FORCE ) set ( RBIO_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( RBIO_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( RBIO_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building RBio version: v" ${RBIO_VERSION_MAJOR}. @@ -43,10 +43,10 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) endif ( ) diff --git a/RBio/Config/RBio.h.in b/RBio/Config/RBio.h.in index 15a86be5ad..ef98a887ae 100644 --- a/RBio/Config/RBio.h.in +++ b/RBio/Config/RBio.h.in @@ -81,11 +81,12 @@ #define RBIO_SUBSUB_VERSION @RBIO_VERSION_SUB@ #define RBIO_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define RBIO_VERSION RBIO_VER_CODE(RBIO_MAIN_VERSION,RBIO_SUB_VERSION) +#define RBIO_VERSION RBIO_VER_CODE(@RBIO_VERSION_MAJOR@,@RBIO_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "RBio @RBIO_VERSION_MAJOR@.@RBIO_VERSION_MINOR@.@RBIO_VERSION_SUB@ requires SuiteSparse_config 7.4.0 or later" +#define RBIO__VERSION SUITESPARSE__VERCODE(@RBIO_VERSION_MAJOR@,@RBIO_VERSION_MINOR@,@RBIO_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "RBio @RBIO_VERSION_MAJOR@.@RBIO_VERSION_MINOR@.@RBIO_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif /* -------------------------------------------------------------------------- */ diff --git a/RBio/Demo/RBdemo.out b/RBio/Demo/RBdemo.out index 8e4242ec0d..a698dcd0c6 100644 --- a/RBio/Demo/RBdemo.out +++ b/RBio/Demo/RBdemo.out @@ -1,89 +1,101 @@ ( cd build && cmake .. && cmake --build . --config Release -j8 ) --- Building RBIO version: v4.3.0 (Dec 30, 2023) --- Source: /Users/davis/dev2/SuiteSparse/RBio --- Build: /Users/davis/dev2/SuiteSparse/RBio/build --- Install lib: lib --- Install include: include --- Install bin: bin --- Install pkg-file: lib --- Install rpath: --- Build rpath: /Users/davis/dev2/SuiteSparse/RBio/build --- Build type: Release --- Fortran: /opt/homebrew/bin/gfortran --- CUDA: not enabled --- SuiteSparse_config version: 7.4.0 --- SuiteSparse_config include: /Users/davis/dev2/SuiteSparse/SuiteSparse_config --- SuiteSparse_config library: /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.7.4.0.dylib --- SuiteSparse_config static: /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- Building RBio version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/RBio +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.5.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.5.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a -- Also compiling the demos in RBio/Demo -- ------------------------------------------------------------------------ --- SuiteSparse CMAKE report for: rbio +-- SuiteSparse CMAKE report for: RBio -- ------------------------------------------------------------------------ --- inside common SuiteSparse root: false --- install in SuiteSparse/lib and SuiteSparse/include: OFF +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 -- build type: Release -- BUILD_SHARED_LIBS: ON -- BUILD_STATIC_LIBS: ON --- use OpenMP: no --- C compiler: /Library/Developer/CommandLineTools/usr/bin/cc +-- C compiler: /usr/bin/cc -- C flags: -- C++ compiler: -- C++ flags: -- C Flags release: -O3 -DNDEBUG -- C++ Flags release: --- Fortran compiler: /opt/homebrew/bin/gfortran +-- Fortran compiler: /usr/bin/f95 -- compile definitions: +-- CUDA architectures: 52;75;80 -- ------------------------------------------------------------------------ --- Configuring done (0.0s) +-- Configuring done (0.7s) -- Generating done (0.0s) --- Build files have been written to: /Users/davis/dev2/SuiteSparse/RBio/build -[ 75%] Built target RBio +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/RBio/build' +[ 37%] Built target RBio [ 75%] Built target RBio_static [100%] Built target RBdemo -( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) --- Building RBIO version: v4.3.0 (Dec 30, 2023) --- Source: /Users/davis/dev2/SuiteSparse/RBio --- Build: /Users/davis/dev2/SuiteSparse/RBio/build --- Install lib: lib --- Install include: include --- Install bin: bin --- Install pkg-file: lib --- Install rpath: --- Build rpath: /Users/davis/dev2/SuiteSparse/RBio/build --- Build type: Release --- Fortran: /opt/homebrew/bin/gfortran --- CUDA: not enabled --- SuiteSparse_config version: 7.4.0 --- SuiteSparse_config include: /Users/davis/dev2/SuiteSparse/SuiteSparse_config --- SuiteSparse_config library: /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.7.4.0.dylib --- SuiteSparse_config static: /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/RBio/build' +( cd build && cmake -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j8 ) +-- Building RBio version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/RBio +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.5.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.5.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a -- Also compiling the demos in RBio/Demo -- ------------------------------------------------------------------------ --- SuiteSparse CMAKE report for: rbio +-- SuiteSparse CMAKE report for: RBio -- ------------------------------------------------------------------------ --- inside common SuiteSparse root: false --- install in SuiteSparse/lib and SuiteSparse/include: OFF +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 -- build type: Release -- BUILD_SHARED_LIBS: ON -- BUILD_STATIC_LIBS: ON --- use OpenMP: no --- C compiler: /Library/Developer/CommandLineTools/usr/bin/cc +-- C compiler: /usr/bin/cc -- C flags: -- C++ compiler: -- C++ flags: -- C Flags release: -O3 -DNDEBUG -- C++ Flags release: --- Fortran compiler: /opt/homebrew/bin/gfortran +-- Fortran compiler: /usr/bin/f95 -- compile definitions: +-- CUDA architectures: 52;75;80 -- ------------------------------------------------------------------------ --- Configuring done (0.0s) +-- Configuring done (0.7s) -- Generating done (0.0s) --- Build files have been written to: /Users/davis/dev2/SuiteSparse/RBio/build +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/RBio/build' [ 75%] Built target RBio [ 75%] Built target RBio_static [100%] Built target RBdemo +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/RBio/build' ./build/RBdemo < ./RBio/private/west0479.rua -RBio version 4.3.0, date: Dec 30, 2023 +RBio version 4.3.1, date: Jan 10, 2024 =========================================================== title: [1U 8 STAGE COLUMN SECTION, ALL SECTIONS RIGOROUS ( CHEM. ENG. )] diff --git a/RBio/Include/RBio.h b/RBio/Include/RBio.h index e7f5815936..e1860a0f29 100644 --- a/RBio/Include/RBio.h +++ b/RBio/Include/RBio.h @@ -75,17 +75,18 @@ #define RBIO_VALUE_IOERROR (-94) /* I/O error: numerical values */ #define RBIO_FILE_IOERROR (-95) /* I/O error: cannot read/write the file */ -#define RBIO_DATE "Dec 30, 2023" +#define RBIO_DATE "Jan 10, 2024" #define RBIO_MAIN_VERSION 4 #define RBIO_SUB_VERSION 3 -#define RBIO_SUBSUB_VERSION 0 +#define RBIO_SUBSUB_VERSION 1 #define RBIO_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define RBIO_VERSION RBIO_VER_CODE(RBIO_MAIN_VERSION,RBIO_SUB_VERSION) +#define RBIO_VERSION RBIO_VER_CODE(4,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "RBio 4.3.0 requires SuiteSparse_config 7.4.0 or later" +#define RBIO__VERSION SUITESPARSE__VERCODE(4,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "RBio 4.3.1 requires SuiteSparse_config 7.5.0 or later" #endif /* -------------------------------------------------------------------------- */ diff --git a/README.md b/README.md index ed40240b78..0c87d35713 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ SuiteSparse: A Suite of Sparse matrix packages at http://suitesparse.com ----------------------------------------------------------------------------- -Dec 30, 2023, SuiteSparse VERSION 7.4.0 +Jan 10, 2024, SuiteSparse VERSION 7.5.0 SuiteSparse is a set of sparse-matrix-related packages written or co-authored by Tim Davis, available at https://github.com/DrTimothyAldenDavis/SuiteSparse . @@ -180,7 +180,7 @@ Packages in SuiteSparse, and files in this directory: CSparse Extended. Includes support for complex matrices and both int or long integers. Use this instead of CSparse for production use; it creates a - libcsparse.so (or *dylib on the Mac) with the same name as CSparse. It is a + libcsparse.so (or dylib on the Mac) with the same name as CSparse. It is a superset of CSparse. Any code that links against CSparse should also be able to link against CXSparse instead. @@ -300,7 +300,7 @@ Packages in SuiteSparse, and files in this directory: author: Tim Davis (all parts) - for spqr_rank: author Les Foster and Tim Davis + for `spqr_rank`: author Les Foster and Tim Davis * `Contents.m` @@ -489,7 +489,7 @@ Thanks for packaging SuiteSparse! Here are some suggestions: * GraphBLAS takes a long time to compile because it creates many fast "FactoryKernels" at compile-time. If you want to reduce the compile time and - library size, enable the GRAPHBLAS_COMPACT mode, but keep the JIT compiler + library size, enable the `GRAPHBLAS_COMPACT` mode, but keep the JIT compiler enabled. Then GraphBLAS will compile the kernels it needs at run-time, via its JIT compiler. Performance will be the same as the FactoryKernels once the JIT kernels are compiled. User compiled kernels are placed in @@ -502,7 +502,7 @@ Thanks for packaging SuiteSparse! Here are some suggestions: * CUDA acceleration: CHOLMOD and SPQR can benefit from their CUDA kernels. If you do not have CUDA or do not want to include it in your distro, this - version of SuiteSparse skips the building of the CHOLMOD_CUDA and SPQR_CUDA + version of SuiteSparse skips the building of the `CHOLMOD_CUDA` and `SPQR_CUDA` libraries, and does not link against the `GPUQREngine` and `SuiteSparse_GPURuntime` libraries. @@ -524,7 +524,7 @@ papers in ACM TOMS, for each package. * For the MATLAB x=A\b, see below for AMD, COLAMD, CHOLMOD, UMFPACK, and SuiteSparseQR (SPQR). -* for GraphBLAS, and `C=A*B` in MATLAB (sparse-times-sparse): +* for GraphBLAS, and C=AB in MATLAB (sparse-times-sparse): T. A. Davis. Algorithm 1037: SuiteSparse:GraphBLAS: Parallel Graph Algorithms in the Language of Sparse Linear Algebra. ACM Trans. Math. Softw. 49, 3, @@ -1184,6 +1184,10 @@ MATLAB/Octave/R/Mathematica interfaces: `p=amd(A)`, `p=colamd(A)`, ... See also Mathematica, R, and many many more. The list is too long. +Julia interface: + + https://github.com/JuliaSparse/SparseArrays.jl + python interface to GraphBLAS by Anaconda and NVIDIA: https://pypi.org/project/python-graphblas diff --git a/SPEX/CMakeLists.txt b/SPEX/CMakeLists.txt index b055fc6901..b7b6544114 100644 --- a/SPEX/CMakeLists.txt +++ b/SPEX/CMakeLists.txt @@ -2,9 +2,9 @@ # SuiteSparse/SPEX/CMakeLists.txt: cmake for SPEX #------------------------------------------------------------------------------- -# Copyright (c) 1996-2023, Timothy A. Davis, Patrick Amestoy, Iain Duff. -# All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause +# SPEX_Left_LU: (c) 2019-2024, Chris Lourenco (US Naval Academy), Jinhao Chen, +# Erick Moreno-Centeno, Timothy A. Davis, Texas A&M. All Rights Reserved. +# SPDX-License-Identifier: GPL-2.0-or-later or LGPL-3.0-or-later #------------------------------------------------------------------------------- # get the version @@ -12,10 +12,10 @@ cmake_minimum_required ( VERSION 3.22 ) -set ( SPEX_DATE "Dec 30, 2023" ) +set ( SPEX_DATE "Jan 10, 2024" ) set ( SPEX_VERSION_MAJOR 2 CACHE STRING "" FORCE ) set ( SPEX_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( SPEX_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( SPEX_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building SPEX version: v" ${SPEX_VERSION_MAJOR}. @@ -45,22 +45,22 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) - find_package ( AMD 3.3.0 + find_package ( AMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::AMD ) - find_package ( AMD 3.3.0 REQUIRED ) + find_package ( AMD 3.3.1 REQUIRED ) endif ( ) - find_package ( COLAMD 3.3.0 + find_package ( COLAMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::COLAMD ) - find_package ( COLAMD 3.3.0 REQUIRED ) + find_package ( COLAMD 3.3.1 REQUIRED ) endif ( ) endif ( ) @@ -205,7 +205,9 @@ if ( BUILD_STATIC_LIBS ) endif ( ) # libm: -if ( NOT WIN32 ) +include ( CheckSymbolExists ) +check_symbol_exists ( fmax "math.h" NO_LIBM ) +if ( NOT NO_LIBM ) if ( BUILD_SHARED_LIBS ) target_link_libraries ( SPEX PRIVATE m ) endif ( ) diff --git a/SPEX/Config/SPEX.h.in b/SPEX/Config/SPEX.h.in index c15be1032e..99a3943a58 100644 --- a/SPEX/Config/SPEX.h.in +++ b/SPEX/Config/SPEX.h.in @@ -265,9 +265,10 @@ #define SPEX_VERSION_MINOR @SPEX_VERSION_MINOR@ #define SPEX_VERSION_SUB @SPEX_VERSION_SUB@ -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "SPEX @SPEX_VERSION_MAJOR@.@SPEX_VERSION_MINOR@.@SPEX_VERSION_SUB@ requires SuiteSparse_config 7.4.0 or later" +#define SPEX__VERSION SUITESPARSE__VERCODE(@SPEX_VERSION_MAJOR@,@SPEX_VERSION_MINOR@,@SPEX_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "SPEX @SPEX_VERSION_MAJOR@.@SPEX_VERSION_MINOR@.@SPEX_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif #if defined ( __cplusplus ) diff --git a/SPEX/Doc/ChangeLog b/SPEX/Doc/ChangeLog index 97a7498e57..16ab050aeb 100644 --- a/SPEX/Doc/ChangeLog +++ b/SPEX/Doc/ChangeLog @@ -1,3 +1,7 @@ +Jan 10, 2024: version 2.3.1 + + * minor updates to build system + Dec 30, 2023: version 2.3.0 * major change to build system: by Markus Mützel diff --git a/SPEX/Doc/SPEX_UserGuide.pdf b/SPEX/Doc/SPEX_UserGuide.pdf index 207eb6ea20..e7fc49d102 100644 Binary files a/SPEX/Doc/SPEX_UserGuide.pdf and b/SPEX/Doc/SPEX_UserGuide.pdf differ diff --git a/SPEX/Doc/SPEX_version.tex b/SPEX/Doc/SPEX_version.tex index 47b864abb2..51c9ad457b 100644 --- a/SPEX/Doc/SPEX_version.tex +++ b/SPEX/Doc/SPEX_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/SPEX -VERSION 2.3.0, Dec 30, 2023 +VERSION 2.3.1, Jan 10, 2024 diff --git a/SPEX/Include/SPEX.h b/SPEX/Include/SPEX.h index c84cbc01a3..af10fd0934 100644 --- a/SPEX/Include/SPEX.h +++ b/SPEX/Include/SPEX.h @@ -259,15 +259,16 @@ // Version //------------------------------------------------------------------------------ -#define SPEX_DATE "Dec 30, 2023" -#define SPEX_VERSION "2.3.0" +#define SPEX_DATE "Jan 10, 2024" +#define SPEX_VERSION "2.3.1" #define SPEX_VERSION_MAJOR 2 #define SPEX_VERSION_MINOR 3 -#define SPEX_VERSION_SUB 0 +#define SPEX_VERSION_SUB 1 -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "SPEX 2.3.0 requires SuiteSparse_config 7.4.0 or later" +#define SPEX__VERSION SUITESPARSE__VERCODE(2,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "SPEX 2.3.1 requires SuiteSparse_config 7.5.0 or later" #endif #if defined ( __cplusplus ) diff --git a/SPEX/SPEX_Left_LU/Demo/demos.c b/SPEX/SPEX_Left_LU/Demo/demos.c index c431557481..50ec654175 100644 --- a/SPEX/SPEX_Left_LU/Demo/demos.c +++ b/SPEX/SPEX_Left_LU/Demo/demos.c @@ -16,8 +16,10 @@ #include "demos.h" +#if defined (__GNUC__) // ignore warnings about unused parameters in this file #pragma GCC diagnostic ignored "-Wunused-parameter" +#endif //------------------------------------------------------------------------------ // SPEX_print_options diff --git a/SPEX/SPEX_Util/Source/SPEX_gmp.c b/SPEX/SPEX_Util/Source/SPEX_gmp.c index 27212a6bfd..0f065799ae 100644 --- a/SPEX/SPEX_Util/Source/SPEX_gmp.c +++ b/SPEX/SPEX_Util/Source/SPEX_gmp.c @@ -64,8 +64,10 @@ #include "spex_util_internal.h" #include "SPEX_gmp.h" +#if defined (__GNUC__) // ignore warnings about unused parameters in this file #pragma GCC diagnostic ignored "-Wunused-parameter" +#endif //------------------------------------------------------------------------------ // global variables @@ -79,9 +81,9 @@ void **spex_gmp_list = NULL ; // list of malloc'd objects int64_t spex_gmp_ntrials = -1 ; // number of malloc's allowed (for // testing only): -1 means unlimited. -mpz_t *spex_gmpz_archive = NULL ; // current mpz object -mpq_t *spex_gmpq_archive = NULL ; // current mpq object -mpfr_t *spex_gmpfr_archive = NULL ; // current mpfr object +mpz_ptr spex_gmpz_archive = NULL ; // current mpz object +mpq_ptr spex_gmpq_archive = NULL ; // current mpq object +mpfr_ptr spex_gmpfr_archive = NULL ; // current mpfr object //------------------------------------------------------------------------------ // spex_gmp_init: initialize gmp diff --git a/SPEX/SPEX_Util/Source/SPEX_gmp.h b/SPEX/SPEX_Util/Source/SPEX_gmp.h index 0e8b448265..f03f3686e2 100644 --- a/SPEX/SPEX_Util/Source/SPEX_gmp.h +++ b/SPEX/SPEX_Util/Source/SPEX_gmp.h @@ -32,7 +32,7 @@ #define SPEX_GMPZ_WRAPPER_START(x) \ { \ - spex_gmpz_archive = (mpz_t *) x; \ + spex_gmpz_archive = x; \ spex_gmpq_archive = NULL; \ spex_gmpfr_archive = NULL; \ SPEX_GMP_WRAPPER_START; \ @@ -41,7 +41,7 @@ #define SPEX_GMPQ_WRAPPER_START(x) \ { \ spex_gmpz_archive = NULL; \ - spex_gmpq_archive =(mpq_t *) x; \ + spex_gmpq_archive = x; \ spex_gmpfr_archive = NULL; \ SPEX_GMP_WRAPPER_START; \ } @@ -50,7 +50,7 @@ { \ spex_gmpz_archive = NULL; \ spex_gmpq_archive = NULL; \ - spex_gmpfr_archive = (mpfr_t *) x; \ + spex_gmpfr_archive = x; \ SPEX_GMP_WRAPPER_START; \ } @@ -69,27 +69,27 @@ { \ if (spex_gmpz_archive != NULL) \ { \ - if (p == SPEX_MPZ_PTR(*spex_gmpz_archive)) \ + if (p == SPEX_MPZ_PTR(spex_gmpz_archive)) \ { \ - SPEX_MPZ_PTR(*spex_gmpz_archive) = NULL ; \ + SPEX_MPZ_PTR(spex_gmpz_archive) = NULL ; \ } \ } \ else if (spex_gmpq_archive != NULL) \ { \ - if (p == SPEX_MPZ_PTR(SPEX_MPQ_NUM(*spex_gmpq_archive))) \ + if (p == SPEX_MPZ_PTR(SPEX_MPQ_NUM(spex_gmpq_archive))) \ { \ - SPEX_MPZ_PTR(SPEX_MPQ_NUM(*spex_gmpq_archive)) = NULL ; \ + SPEX_MPZ_PTR(SPEX_MPQ_NUM(spex_gmpq_archive)) = NULL ; \ } \ - if (p == SPEX_MPZ_PTR(SPEX_MPQ_DEN(*spex_gmpq_archive))) \ + if (p == SPEX_MPZ_PTR(SPEX_MPQ_DEN(spex_gmpq_archive))) \ { \ - SPEX_MPZ_PTR(SPEX_MPQ_DEN(*spex_gmpq_archive)) = NULL ; \ + SPEX_MPZ_PTR(SPEX_MPQ_DEN(spex_gmpq_archive)) = NULL ; \ } \ } \ else if (spex_gmpfr_archive != NULL) \ { \ - if (p == SPEX_MPFR_REAL_PTR(*spex_gmpfr_archive)) \ + if (p == SPEX_MPFR_REAL_PTR(spex_gmpfr_archive)) \ { \ - SPEX_MPFR_MANT(*spex_gmpfr_archive) = NULL ; \ + SPEX_MPFR_MANT(spex_gmpfr_archive) = NULL ; \ } \ } \ SPEX_FREE (p) ; \ diff --git a/SPEX/SPEX_Util/Source/SPEX_matrix_allocate.c b/SPEX/SPEX_Util/Source/SPEX_matrix_allocate.c index 5b06767236..eaf97f30e8 100644 --- a/SPEX/SPEX_Util/Source/SPEX_matrix_allocate.c +++ b/SPEX/SPEX_Util/Source/SPEX_matrix_allocate.c @@ -21,6 +21,15 @@ #include "spex_util_internal.h" +#if defined (__GNUC__) + #if ( __GNUC__ == 11) + // gcc 11 has a bug that triggers a spurious warning for the call + // to SPEX_mpq_init (A->scale), from -Wstringop-overflow. see + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854 + #pragma GCC diagnostic ignored "-Wstringop-overflow" + #endif +#endif + SPEX_info SPEX_matrix_allocate ( SPEX_matrix **A_handle, // matrix to allocate diff --git a/SPEX/SPEX_Util/Source/SPEX_matrix_free.c b/SPEX/SPEX_Util/Source/SPEX_matrix_free.c index 7c3606ac77..fcf5561d44 100644 --- a/SPEX/SPEX_Util/Source/SPEX_matrix_free.c +++ b/SPEX/SPEX_Util/Source/SPEX_matrix_free.c @@ -9,7 +9,10 @@ //------------------------------------------------------------------------------ // Free a SPEX_matrix. Any shallow component is not freed. +#if defined (__GNUC__) #pragma GCC diagnostic ignored "-Wunused-variable" +#endif + #include "spex_util_internal.h" SPEX_info SPEX_matrix_free diff --git a/SPEX/SPEX_Util/Source/SPEX_matrix_nnz.c b/SPEX/SPEX_Util/Source/SPEX_matrix_nnz.c index f8adde03dc..dbb7a6040c 100644 --- a/SPEX/SPEX_Util/Source/SPEX_matrix_nnz.c +++ b/SPEX/SPEX_Util/Source/SPEX_matrix_nnz.c @@ -8,7 +8,10 @@ //------------------------------------------------------------------------------ +#if defined (__GNUC__) #pragma GCC diagnostic ignored "-Wunused-variable" +#endif + #include "spex_util_internal.h" diff --git a/SPEX/SPEX_Util/Source/spex_cast_array.c b/SPEX/SPEX_Util/Source/spex_cast_array.c index 7f385a45b2..5b436d6ca4 100644 --- a/SPEX/SPEX_Util/Source/spex_cast_array.c +++ b/SPEX/SPEX_Util/Source/spex_cast_array.c @@ -38,7 +38,10 @@ SPEX_MPQ_CLEAR(temp); \ #include "spex_util_internal.h" + +#if defined (__GNUC__) #pragma GCC diagnostic ignored "-Wunused-variable" +#endif SPEX_info spex_cast_array ( diff --git a/SPEX/SPEX_Util/Source/spex_util_internal.h b/SPEX/SPEX_Util/Source/spex_util_internal.h index 4d74cf8052..7fe654e93d 100644 --- a/SPEX/SPEX_Util/Source/spex_util_internal.h +++ b/SPEX/SPEX_Util/Source/spex_util_internal.h @@ -14,8 +14,10 @@ #ifndef SPEX_UTIL_INTERNAL_H #define SPEX_UTIL_INTERNAL_H +#if defined (__GNUC__) #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-value" +#endif //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ @@ -106,16 +108,16 @@ #include "SPEX.h" #if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "SPEX requires SuiteSparse_config 7.4.0 or later" + (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,5)) +#error "SPEX requires SuiteSparse_config 7.5.0 or later" #endif #if (AMD_VERSION < SUITESPARSE_VER_CODE(3,3)) -#error "SPEX requires AMD 3.3.0 or later" +#error "SPEX requires AMD 3.3.1 or later" #endif #if (COLAMD_VERSION < SUITESPARSE_VER_CODE(3,3)) -#error "SPEX requires COLAMD 3.3.0 or later" +#error "SPEX requires COLAMD 3.3.1 or later" #endif //------------------------------------------------------------------------------ diff --git a/SPQR/CMakeLists.txt b/SPQR/CMakeLists.txt index e1f49e517b..ee4d0cf23b 100644 --- a/SPQR/CMakeLists.txt +++ b/SPQR/CMakeLists.txt @@ -2,7 +2,7 @@ # SuiteSparse/SPQR/CMakeLists.txt: cmake for SuiteSparseQR (aka "SPQR") #------------------------------------------------------------------------------- -# SPQR (SuiteSparseQR), Copyright (c) 2008-2023, Timothy A Davis. +# SPQR (SuiteSparseQR), Copyright (c) 2008-2024, Timothy A Davis. # All Rights Reserved. # SPDX-License-Identifier: GPL-2.0+ @@ -13,10 +13,10 @@ # cmake 3.22 is required to find the BLAS in SuiteSparsePolicy.cmake cmake_minimum_required ( VERSION 3.22 ) -set ( SPQR_DATE "Dec 30, 2023" ) +set ( SPQR_DATE "Jan 10, 2024" ) set ( SPQR_VERSION_MAJOR 4 CACHE STRING "" FORCE ) set ( SPQR_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( SPQR_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( SPQR_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building SPQR version: v" ${SPQR_VERSION_MAJOR}. @@ -45,16 +45,16 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) - find_package ( CHOLMOD 5.1.0 + find_package ( CHOLMOD 5.1.1 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::CHOLMOD ) - find_package ( CHOLMOD 5.1.0 REQUIRED ) + find_package ( CHOLMOD 5.1.1 REQUIRED ) endif ( ) endif ( ) @@ -191,25 +191,17 @@ if ( SPQR_HAS_CUDA ) if ( BUILD_STATIC_LIBS ) target_link_libraries ( SPQR_static PRIVATE GPUQREngine_static GPURuntime_static ) target_compile_definitions ( SPQR_static PUBLIC "SPQR_HAS_CUDA" ) + set ( SPQR_STATIC_MODULES "${SPQR_STATIC_MODULES} GPUQREngine SuiteSparse_GPURuntime" ) endif ( ) add_subdirectory ( SPQRGPU ) else ( ) set ( SPQR_CFLAGS "" ) endif ( ) -# OpenMP: -if ( OpenMP_CXX_FOUND ) - if ( BUILD_SHARED_LIBS ) - target_link_libraries ( SPQR PRIVATE OpenMP::OpenMP_CXX ) - endif ( ) - if ( BUILD_STATIC_LIBS ) - target_link_libraries ( SPQR_static PRIVATE OpenMP::OpenMP_CXX ) - list ( APPEND SPQR_STATIC_LIBS ${OpenMP_CXX_LIBRARIES} ) - endif ( ) -endif ( ) - # libm: -if ( NOT WIN32 ) +include ( CheckSymbolExists ) +check_symbol_exists ( fmax "math.h" NO_LIBM ) +if ( NOT NO_LIBM ) if ( BUILD_SHARED_LIBS ) target_link_libraries ( SPQR PRIVATE m ) endif ( ) diff --git a/SPQR/Config/SPQR.pc.in b/SPQR/Config/SPQR.pc.in index 2d8a907eef..e5f600f7a2 100644 --- a/SPQR/Config/SPQR.pc.in +++ b/SPQR/Config/SPQR.pc.in @@ -13,7 +13,7 @@ Name: SPQR URL: https://github.com/DrTimothyAldenDavis/SuiteSparse Description: Multithreaded, multifrontal, rank-revealing sparse QR factorization method in SuiteSparse Version: @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@ -Requires.private: SuiteSparse_config CHOLMOD +Requires.private: SuiteSparse_config CHOLMOD @SPQR_STATIC_MODULES@ Libs: -L${libdir} -l@SUITESPARSE_LIB_BASE_NAME@ Libs.private: @SPQR_STATIC_LIBS@ Cflags: -I${includedir} @SPQR_CFLAGS@ diff --git a/SPQR/Config/SuiteSparseQR_definitions.h.in b/SPQR/Config/SuiteSparseQR_definitions.h.in index 6938e55b30..596db69109 100644 --- a/SPQR/Config/SuiteSparseQR_definitions.h.in +++ b/SPQR/Config/SuiteSparseQR_definitions.h.in @@ -70,15 +70,17 @@ #define SPQR_SUBSUB_VERSION @SPQR_VERSION_SUB@ #define SPQR_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define SPQR_VERSION SPQR_VER_CODE(SPQR_MAIN_VERSION,SPQR_SUB_VERSION) +#define SPQR_VERSION SPQR_VER_CODE(@SPQR_VERSION_MAJOR@,@SPQR_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "SPQR @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@ requires SuiteSparse_config 7.4.0 or later" +#define SPQR__VERSION SUITESPARSE__VERCODE(@SPQR_VERSION_MAJOR@,@SPQR_VERSION_MINOR@,@SPQR_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "SPQR @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif -#if (CHOLMOD_VERSION < SUITESPARSE_VER_CODE(5,1)) -#error "SPQR @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@ requires CHOLMOD 5.1.0 or later" +#if !defined (CHOLMOD__VERSION) || \ + (CHOLMOD__VERSION < SUITESPARSE__VERCODE(5,1,1)) +#error "SPQR @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@ requires CHOLMOD 5.1.1 or later" #endif #endif diff --git a/SPQR/Demo/README.txt b/SPQR/Demo/README.txt index fdd767a4cd..0af8ac844f 100644 --- a/SPQR/Demo/README.txt +++ b/SPQR/Demo/README.txt @@ -21,8 +21,8 @@ qrdemo.m MATLAB equivalent of qrdemo.cpp. To compare with the C++ -------------------------------------------------------------------------------- -qrdemoc.c C demo program, compile and test it with "make cdemo" -qrdemoc_out.txt output of "make cdemo" +qrdemoc.c C demo program, compile and test it with "make demos" +qrdemoc_out.txt output of "make demos" -------------------------------------------------------------------------------- diff --git a/SPQR/Demo/go4.m b/SPQR/Demo/go4.m index c5bcd4dbd9..a471e50733 100644 --- a/SPQR/Demo/go4.m +++ b/SPQR/Demo/go4.m @@ -14,7 +14,7 @@ nmat = length (f) ; keep = ones (nmat,1) ; -kinds = UFkinds ; +kinds = sskinds ; for k = 1:nmat id = f (k) ; if (~isempty (strfind (kinds {id}, 'subsequent'))) diff --git a/SPQR/Demo/go5.m b/SPQR/Demo/go5.m index 261524d89e..96879d7962 100644 --- a/SPQR/Demo/go5.m +++ b/SPQR/Demo/go5.m @@ -14,7 +14,7 @@ nmat = length (f) ; keep = ones (nmat,1) ; -kinds = UFkinds ; +kinds = sskinds ; for k = 1:nmat id = f (k) ; if (~isempty (strfind (kinds {id}, 'subsequent'))) diff --git a/SPQR/Demo/spqr_demo.out b/SPQR/Demo/spqr_demo.out index 08794005e8..e1b435f3c1 100644 --- a/SPQR/Demo/spqr_demo.out +++ b/SPQR/Demo/spqr_demo.out @@ -1,60 +1,81 @@ ( cd build && cmake .. && cmake --build . --config Release -j8 ) --- Building SPQR version: v4.3.0 (Dec 30, 2023) --- Source: /home/davis/dev2/SuiteSparse/SPQR --- Build: /home/davis/dev2/SuiteSparse/SPQR/build --- Install lib: lib --- Install include: include --- Install bin: bin --- Install pkg-file: lib --- Install rpath: --- Build rpath: /home/davis/dev2/SuiteSparse/SPQR/build --- Build type: Release --- Fortran: /usr/bin/f95 --- Looking for CUDA --- CUDA: not found --- CUDA: not enabled --- SuiteSparse_config version: 7.4.0 --- SuiteSparse_config include: /home/davis/dev2/SuiteSparse/SuiteSparse_config --- SuiteSparse_config library: /home/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.4.0 --- SuiteSparse_config static: /home/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a --- AMD version: 3.3.0 --- AMD include: /home/davis/dev2/SuiteSparse/AMD/Include --- AMD library: /home/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.3.0 --- AMD static: /home/davis/dev2/SuiteSparse/AMD/build/libamd.a --- COLAMD version: 3.3.0 --- COLAMD include: /home/davis/dev2/SuiteSparse/COLAMD/Include --- COLAMD library: /home/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.3.0 --- COLAMD static: /home/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a --- CAMD version: 3.3.0 --- CAMD include: /home/davis/dev2/SuiteSparse/CAMD/Include --- CAMD library: /home/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.3.0 --- CAMD static: /home/davis/dev2/SuiteSparse/CAMD/build/libcamd.a --- CCOLAMD version: 3.3.0 --- CCOLAMD include: /home/davis/dev2/SuiteSparse/CCOLAMD/Include --- CCOLAMD library: /home/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.3.0 --- CCOLAMD static: /home/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a --- CHOLMOD version: 5.1.0 --- CHOLMOD include: /home/davis/dev2/SuiteSparse/CHOLMOD/Include --- CHOLMOD library: /home/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.5.1.0 --- CHOLMOD static: /home/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a +-- Building SPQR version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.5.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.5.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- AMD version: 3.3.1 +-- AMD include: /home/faculty/d/davis/dev2/SuiteSparse/AMD/Include +-- AMD library: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.3.1 +-- AMD static: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.a +-- COLAMD version: 3.3.1 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/Include +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.3.1 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a +-- CAMD version: 3.3.1 +-- CAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/Include +-- CAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.3.1 +-- CAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.a +-- CCOLAMD version: 3.3.1 +-- CCOLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/Include +-- CCOLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.3.1 +-- CCOLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a +-- CHOLMOD version: 5.1.1 +-- CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/Include +-- CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.5.1.1 +-- CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a -- Looking for Intel 32-bit BLAS -- Found Intel10_64lp 32-bit BLAS --- LAPACK libraries: /opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gf_lp64.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gnu_thread.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl +-- Building SPQR/GPURUNTIME version: v4.3.1 (Jan 10, 2024) +-- Building SPQR/GPUQRENGINE version: v4.3.1 (Jan 10, 2024) +-- Also compiling the demos in GPUQREngine/Demo +-- Building SPQR_CUDA version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled +-- C++ flags for CUDA: +-- LAPACK libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl -- LAPACK include: -- LAPACK linker flags: --- BLAS libraries: /opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gf_lp64.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gnu_thread.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so;-lpthread;-lm;-ldl +-- BLAS libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl -- BLAS include: -- BLAS linker flags: -- Also compiling the demos in SPQR/Demo -- ------------------------------------------------------------------------ --- SuiteSparse CMAKE report for: spqr +-- SuiteSparse CMAKE report for: SPQR -- ------------------------------------------------------------------------ --- inside common SuiteSparse root: false --- install in SuiteSparse/lib and SuiteSparse/include: OFF +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 -- build type: Release -- BUILD_SHARED_LIBS: ON -- BUILD_STATIC_LIBS: ON --- use OpenMP: no -- C compiler: /usr/bin/cc -- C flags: -- C++ compiler: /usr/bin/c++ @@ -64,107 +85,108 @@ -- Fortran compiler: /usr/bin/f95 -- compile definitions: BLAS_Intel10_64lp -- BLAS integer: int32_t +-- CUDA architectures: 52;75;80 -- ------------------------------------------------------------------------ --- Configuring done --- Generating done --- Build files have been written to: /home/davis/dev2/SuiteSparse/SPQR/build -make[1]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[2]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target SPQR_static -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target SPQR -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -[ 42%] Built target SPQR_static -[ 85%] Built target SPQR -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrsimplec -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrsimple -Consolidate compiler generated dependencies of target qrdemoc_int32 -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrdemo_int32 -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrsimplec_int32 -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrdemoc -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrdemo -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -[ 87%] Built target qrsimplec -[ 89%] Built target qrdemoc_int32 -[ 91%] Built target qrdemo -[ 93%] Built target qrdemo_int32 -[ 95%] Built target qrdemoc -[ 97%] Built target qrsimplec_int32 -[100%] Built target qrsimple -make[2]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[1]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) --- Building SPQR version: v4.3.0 (Dec 30, 2023) --- Source: /home/davis/dev2/SuiteSparse/SPQR --- Build: /home/davis/dev2/SuiteSparse/SPQR/build --- Install lib: lib --- Install include: include --- Install bin: bin --- Install pkg-file: lib --- Install rpath: --- Build rpath: /home/davis/dev2/SuiteSparse/SPQR/build --- Build type: Release --- Fortran: /usr/bin/f95 --- Looking for CUDA --- CUDA: not found --- CUDA: not enabled --- SuiteSparse_config version: 7.4.0 --- SuiteSparse_config include: /home/davis/dev2/SuiteSparse/SuiteSparse_config --- SuiteSparse_config library: /home/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.4.0 --- SuiteSparse_config static: /home/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a --- AMD version: 3.3.0 --- AMD include: /home/davis/dev2/SuiteSparse/AMD/Include --- AMD library: /home/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.3.0 --- AMD static: /home/davis/dev2/SuiteSparse/AMD/build/libamd.a --- COLAMD version: 3.3.0 --- COLAMD include: /home/davis/dev2/SuiteSparse/COLAMD/Include --- COLAMD library: /home/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.3.0 --- COLAMD static: /home/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a --- CAMD version: 3.3.0 --- CAMD include: /home/davis/dev2/SuiteSparse/CAMD/Include --- CAMD library: /home/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.3.0 --- CAMD static: /home/davis/dev2/SuiteSparse/CAMD/build/libcamd.a --- CCOLAMD version: 3.3.0 --- CCOLAMD include: /home/davis/dev2/SuiteSparse/CCOLAMD/Include --- CCOLAMD library: /home/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.3.0 --- CCOLAMD static: /home/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a --- CHOLMOD version: 5.1.0 --- CHOLMOD include: /home/davis/dev2/SuiteSparse/CHOLMOD/Include --- CHOLMOD library: /home/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.5.1.0 --- CHOLMOD static: /home/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a +-- Configuring done (0.9s) +-- Generating done (0.1s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +[ 3%] Built target GPURuntime +[ 7%] Built target GPURuntime_static +[ 15%] Built target GPUQREngine +[ 23%] Built target GPUQREngine_static +[ 25%] Built target gpuqrengine_demo +[ 56%] Built target SPQR +[ 86%] Built target SPQR_static +[ 87%] Built target qrdemoc +[ 88%] Built target qrsimplec +[ 89%] Built target qrdemo +[ 91%] Built target qrdemo_int32 +[ 93%] Built target qrsimple +[ 95%] Built target qrsimplec_int32 +[ 96%] Built target qrdemoc_int32 +[ 98%] Built target qrdemo_gpu +[ 99%] Built target qrdemo_gpu2 +[100%] Built target qrdemo_gpu3 +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +( cd build && cmake -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j8 ) +-- Building SPQR version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.5.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.5.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- AMD version: 3.3.1 +-- AMD include: /home/faculty/d/davis/dev2/SuiteSparse/AMD/Include +-- AMD library: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.3.1 +-- AMD static: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.a +-- COLAMD version: 3.3.1 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/Include +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.3.1 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a +-- CAMD version: 3.3.1 +-- CAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/Include +-- CAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.3.1 +-- CAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.a +-- CCOLAMD version: 3.3.1 +-- CCOLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/Include +-- CCOLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.3.1 +-- CCOLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a +-- CHOLMOD version: 5.1.1 +-- CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/Include +-- CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.5.1.1 +-- CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a -- Looking for Intel 32-bit BLAS -- Found Intel10_64lp 32-bit BLAS --- LAPACK libraries: /opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gf_lp64.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gnu_thread.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl +-- Building SPQR/GPURUNTIME version: v4.3.1 (Jan 10, 2024) +-- Building SPQR/GPUQRENGINE version: v4.3.1 (Jan 10, 2024) +-- Also compiling the demos in GPUQREngine/Demo +-- Building SPQR_CUDA version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled +-- C++ flags for CUDA: +-- LAPACK libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl -- LAPACK include: -- LAPACK linker flags: --- BLAS libraries: /opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gf_lp64.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gnu_thread.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so;-lpthread;-lm;-ldl +-- BLAS libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl -- BLAS include: -- BLAS linker flags: -- Also compiling the demos in SPQR/Demo -- ------------------------------------------------------------------------ --- SuiteSparse CMAKE report for: spqr +-- SuiteSparse CMAKE report for: SPQR -- ------------------------------------------------------------------------ --- inside common SuiteSparse root: false --- install in SuiteSparse/lib and SuiteSparse/include: OFF +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 -- build type: Release -- BUILD_SHARED_LIBS: ON -- BUILD_STATIC_LIBS: ON --- use OpenMP: no -- C compiler: /usr/bin/cc -- C flags: -- C++ compiler: /usr/bin/c++ @@ -174,50 +196,30 @@ make[1]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -- Fortran compiler: /usr/bin/f95 -- compile definitions: BLAS_Intel10_64lp -- BLAS integer: int32_t +-- CUDA architectures: 52;75;80 -- ------------------------------------------------------------------------ --- Configuring done --- Generating done --- Build files have been written to: /home/davis/dev2/SuiteSparse/SPQR/build -make[1]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[2]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target SPQR_static -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target SPQR -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -[ 42%] Built target SPQR_static -[ 85%] Built target SPQR -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrsimplec -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrdemoc -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrsimplec_int32 -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrsimple -Consolidate compiler generated dependencies of target qrdemo -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrdemo_int32 -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrdemoc_int32 -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -[ 87%] Built target qrdemoc -[ 89%] Built target qrsimplec -[ 91%] Built target qrsimplec_int32 -[ 93%] Built target qrdemo -[ 95%] Built target qrdemoc_int32 -[ 97%] Built target qrdemo_int32 -[100%] Built target qrsimple -make[2]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[1]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' +-- Configuring done (0.9s) +-- Generating done (0.1s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +[ 3%] Built target GPURuntime +[ 7%] Built target GPURuntime_static +[ 15%] Built target GPUQREngine +[ 23%] Built target GPUQREngine_static +[ 25%] Built target gpuqrengine_demo +[ 56%] Built target SPQR +[ 86%] Built target SPQR_static +[ 87%] Built target qrdemoc_int32 +[ 88%] Built target qrdemoc +[ 90%] Built target qrsimple +[ 91%] Built target qrsimplec +[ 93%] Built target qrsimplec_int32 +[ 96%] Built target qrdemo_int32 +[ 96%] Built target qrdemo +[ 98%] Built target qrdemo_gpu +[ 99%] Built target qrdemo_gpu2 +[100%] Built target qrdemo_gpu3 +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' ./build/qrdemo < Matrix/a00.mtx Matrix 0-by-0 nnz: 0 relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 @@ -268,7 +270,7 @@ relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 ./build/qrdemo < Matrix/west0067.mtx Matrix 67-by-67 nnz: 294 relative norm(Ax-b): 6.3e-17 rank: 67 rel. norm(A'(Ax-b)) 2.5e-15 -relative norm(Ax-b): 5.8e-17 rank: 67 rel. norm(A'(Ax-b)) 2.2e-15 +relative norm(Ax-b): 5.9e-17 rank: 67 rel. norm(A'(Ax-b)) 2.2e-15 relative norm(Ax-b): 4.4e-17 rank: 67 rel. norm(A'(Ax-b)) 1.0e-13 ./build/qrdemo < Matrix/c2.mtx Matrix 2-by-2 nnz: 4 @@ -435,63 +437,84 @@ Matrix 24-by-24 nnz: 81 residual: 2.1e-02 rank: 18 Matrix 841-by-841 nnz: 4089 residual: 1.8e-16 rank: 841 ./build/qrdemoc < Matrix/lp_e226_transposed.mtx Matrix 472-by-223 nnz: 2768 residual: 9.2e+00 rank: 223 -( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) --- Building SPQR version: v4.3.0 (Dec 30, 2023) --- Source: /home/davis/dev2/SuiteSparse/SPQR --- Build: /home/davis/dev2/SuiteSparse/SPQR/build --- Install lib: lib --- Install include: include --- Install bin: bin --- Install pkg-file: lib --- Install rpath: --- Build rpath: /home/davis/dev2/SuiteSparse/SPQR/build --- Build type: Release --- Fortran: /usr/bin/f95 --- Looking for CUDA --- CUDA: not found --- CUDA: not enabled --- SuiteSparse_config version: 7.4.0 --- SuiteSparse_config include: /home/davis/dev2/SuiteSparse/SuiteSparse_config --- SuiteSparse_config library: /home/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.4.0 --- SuiteSparse_config static: /home/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a --- AMD version: 3.3.0 --- AMD include: /home/davis/dev2/SuiteSparse/AMD/Include --- AMD library: /home/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.3.0 --- AMD static: /home/davis/dev2/SuiteSparse/AMD/build/libamd.a --- COLAMD version: 3.3.0 --- COLAMD include: /home/davis/dev2/SuiteSparse/COLAMD/Include --- COLAMD library: /home/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.3.0 --- COLAMD static: /home/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a --- CAMD version: 3.3.0 --- CAMD include: /home/davis/dev2/SuiteSparse/CAMD/Include --- CAMD library: /home/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.3.0 --- CAMD static: /home/davis/dev2/SuiteSparse/CAMD/build/libcamd.a --- CCOLAMD version: 3.3.0 --- CCOLAMD include: /home/davis/dev2/SuiteSparse/CCOLAMD/Include --- CCOLAMD library: /home/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.3.0 --- CCOLAMD static: /home/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a --- CHOLMOD version: 5.1.0 --- CHOLMOD include: /home/davis/dev2/SuiteSparse/CHOLMOD/Include --- CHOLMOD library: /home/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.5.1.0 --- CHOLMOD static: /home/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a +( cd build && cmake -DSUITESPARSE_DEMOS=1 .. && cmake --build . --config Release -j8 ) +-- Building SPQR version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.5.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.5.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- AMD version: 3.3.1 +-- AMD include: /home/faculty/d/davis/dev2/SuiteSparse/AMD/Include +-- AMD library: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.3.1 +-- AMD static: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.a +-- COLAMD version: 3.3.1 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/Include +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.3.1 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a +-- CAMD version: 3.3.1 +-- CAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/Include +-- CAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.3.1 +-- CAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.a +-- CCOLAMD version: 3.3.1 +-- CCOLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/Include +-- CCOLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.3.1 +-- CCOLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a +-- CHOLMOD version: 5.1.1 +-- CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/Include +-- CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.5.1.1 +-- CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a -- Looking for Intel 32-bit BLAS -- Found Intel10_64lp 32-bit BLAS --- LAPACK libraries: /opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gf_lp64.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gnu_thread.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl +-- Building SPQR/GPURUNTIME version: v4.3.1 (Jan 10, 2024) +-- Building SPQR/GPUQRENGINE version: v4.3.1 (Jan 10, 2024) +-- Also compiling the demos in GPUQREngine/Demo +-- Building SPQR_CUDA version: v4.3.1 (Jan 10, 2024) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include/suitesparse +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install pkg-file: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install rpath: $ORIGIN;/home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA toolkit : TRUE +-- CUDA toolkit ver: 11.7.99 +-- CUDA toolkit inc: /usr/local/cuda/include +-- CUDA toolkit lib: /usr/local/cuda/lib64 +-- CUDA: enabled +-- C++ flags for CUDA: +-- LAPACK libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl -- LAPACK include: -- LAPACK linker flags: --- BLAS libraries: /opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gf_lp64.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_gnu_thread.so;/opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so;-lpthread;-lm;-ldl +-- BLAS libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl -- BLAS include: -- BLAS linker flags: -- Also compiling the demos in SPQR/Demo -- ------------------------------------------------------------------------ --- SuiteSparse CMAKE report for: spqr +-- SuiteSparse CMAKE report for: SPQR -- ------------------------------------------------------------------------ --- inside common SuiteSparse root: false --- install in SuiteSparse/lib and SuiteSparse/include: OFF +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 -- build type: Release -- BUILD_SHARED_LIBS: ON -- BUILD_STATIC_LIBS: ON --- use OpenMP: no -- C compiler: /usr/bin/cc -- C flags: -- C++ compiler: /usr/bin/c++ @@ -501,50 +524,30 @@ Matrix 472-by-223 nnz: 2768 residual: 9.2e+00 rank: 223 -- Fortran compiler: /usr/bin/f95 -- compile definitions: BLAS_Intel10_64lp -- BLAS integer: int32_t +-- CUDA architectures: 52;75;80 -- ------------------------------------------------------------------------ --- Configuring done --- Generating done --- Build files have been written to: /home/davis/dev2/SuiteSparse/SPQR/build -make[1]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[2]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target SPQR_static -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target SPQR -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -[ 42%] Built target SPQR_static -[ 85%] Built target SPQR -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Entering directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrsimple -Consolidate compiler generated dependencies of target qrdemo -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrsimplec_int32 -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrdemoc_int32 -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrsimplec -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrdemoc -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -Consolidate compiler generated dependencies of target qrdemo_int32 -make[3]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -[ 87%] Built target qrdemo +-- Configuring done (0.9s) +-- Generating done (0.1s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +[ 3%] Built target GPURuntime +[ 7%] Built target GPURuntime_static +[ 15%] Built target GPUQREngine +[ 23%] Built target GPUQREngine_static +[ 25%] Built target gpuqrengine_demo +[ 56%] Built target SPQR +[ 86%] Built target SPQR_static +[ 87%] Built target qrsimplec [ 89%] Built target qrsimplec_int32 -[ 91%] Built target qrsimplec -[ 93%] Built target qrdemoc -[ 95%] Built target qrsimple -[ 97%] Built target qrdemoc_int32 -[100%] Built target qrdemo_int32 -make[2]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' -make[1]: Leaving directory '/home/davis/dev2/SuiteSparse/SPQR/build' +[ 90%] Built target qrdemoc_int32 +[ 92%] Built target qrdemo_int32 +[ 94%] Built target qrsimple +[ 95%] Built target qrdemoc +[ 96%] Built target qrdemo +[ 98%] Built target qrdemo_gpu +[ 99%] Built target qrdemo_gpu3 +[100%] Built target qrdemo_gpu2 +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' ./build/qrdemo_int32 < Matrix/a00.mtx Matrix 0-by-0 nnz: 0 relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 @@ -699,7 +702,7 @@ relative norm(Ax-b): 1.8e-16 rank: 841 rel. norm(A'(Ax-b)) 7.1e-14 Matrix 472-by-223 nnz: 2768 relative norm(Ax-b): 9.2e+00 rank: 223 rel. norm(A'(Ax-b)) 1.5e-13 relative norm(Ax-b): 9.2e+00 rank: 223 rel. norm(A'(Ax-b)) 1.5e-13 -relative norm(Ax-b): 2.0e+03 rank: 223 rel. norm(A'(Ax-b)) 2.1e-11 +relative norm(Ax-b): 2.0e+03 rank: 223 rel. norm(A'(Ax-b)) 1.3e-11 ./build/qrdemoc_int32 < Matrix/a2.mtx Matrix 2-by-2 nnz: 3 residual: 0.0e+00 rank: 2 ./build/qrdemoc_int32 < Matrix/r2.mtx diff --git a/SPQR/Doc/ChangeLog b/SPQR/Doc/ChangeLog index e00b72cf72..d298ba9802 100644 --- a/SPQR/Doc/ChangeLog +++ b/SPQR/Doc/ChangeLog @@ -1,3 +1,8 @@ +Jan 10, 2024: version 4.3.1 + + * MATLAB interface: add -DNO_SSIZE_T for Windows + * minor updates to build system + Dec 30, 2023: version 4.3.0 * major change to build system: by Markus Mützel diff --git a/SPQR/Doc/spqr_user_guide.pdf b/SPQR/Doc/spqr_user_guide.pdf index 3feb9b8142..60978c5601 100644 Binary files a/SPQR/Doc/spqr_user_guide.pdf and b/SPQR/Doc/spqr_user_guide.pdf differ diff --git a/SPQR/Doc/spqr_version.tex b/SPQR/Doc/spqr_version.tex index 5d1ee64638..d3ee28441f 100644 --- a/SPQR/Doc/spqr_version.tex +++ b/SPQR/Doc/spqr_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/SPQR -\date{VERSION 4.3.0, Dec 30, 2023} +\date{VERSION 4.3.1, Jan 10, 2024} diff --git a/SPQR/GPUQREngine/CMakeLists.txt b/SPQR/GPUQREngine/CMakeLists.txt index 686f0fbfa0..8c5451dc3f 100644 --- a/SPQR/GPUQREngine/CMakeLists.txt +++ b/SPQR/GPUQREngine/CMakeLists.txt @@ -43,10 +43,10 @@ set ( DEMO_OK false ) if ( NOT SUITESPARSE_ROOT_CMAKELISTS AND SUITESPARSE_DEMOS AND DEMO_OK ) # for the demo only: - find_package ( CHOLMOD 5.1.0 + find_package ( CHOLMOD 5.1.1 PATHS ${CMAKE_SOURCE_DIR}/../../CHOLMOD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::CHOLMOD ) - find_package ( CHOLMOD 5.1.0 ) + find_package ( CHOLMOD 5.1.1 ) endif ( ) endif ( ) @@ -66,7 +66,12 @@ configure_file ( "Config/GPUQREngine.hpp.in" #------------------------------------------------------------------------------- -file ( GLOB GPUQRENGINE_SOURCES "Source/*.cpp" "Source/*.cu" "Source/*/*.cpp" ) +file ( GLOB GPUQRENGINE_SOURCES "Source/*.cpp" + "Source/*.cu" + "Source/BucketList/BucketList.cpp" + "Source/LLBundle/LLBundle.cpp" + "Source/Scheduler/Scheduler.cpp" + "Source/TaskDescriptor/*.cpp" ) set ( GPUQRENGINE_INCLUDES Include Include/Kernel Include/Kernel/Apply Include/Kernel/Assemble Include/Kernel/Factorize ) @@ -142,9 +147,17 @@ if ( BUILD_STATIC_LIBS ) CUDA_SEPARABLE_COMPILATION ON CUDA_RESOLVE_DEVICE_SYMBOLS ON CUDA_RUNTIME_LIBRARY Static ) - target_link_libraries ( GPUQREngine_static PRIVATE - CUDA::nvrtc CUDA::cudart_static CUDA::cublas ) + target_link_libraries ( GPUQREngine_static PRIVATE CUDA::nvrtc CUDA::cudart_static ) target_compile_definitions ( GPUQREngine_static PRIVATE "SPQR_HAS_CUDA" ) + # FIXME: Ok to hardcode CUDA library names like this? + set ( GPUQRENGINE_STATIC_LIBS "-L${CUDAToolkit_LIBRARY_DIR} -lcuda -lcudart_static" ) + if ( TARGET CUDA::cublas_static ) + target_link_libraries ( GPUQREngine_static PRIVATE CUDA::cublas_static ) + set ( GPUQRENGINE_STATIC_LIBS "${GPUQRENGINE_STATIC_LIBS} -lcublas_static -lcublasLt_static -lculibos" ) + else ( ) + target_link_libraries ( GPUQREngine_static PRIVATE CUDA::cublas ) + set ( GPUQRENGINE_STATIC_LIBS "${GPUQRENGINE_STATIC_LIBS} -lcublas" ) + endif ( ) target_include_directories ( GPUQREngine_static INTERFACE $ @@ -215,11 +228,20 @@ if ( NOT MSVC ) else ( ) set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") endif ( ) + if ( BUILD_SHARED_LIBS ) + set ( SUITESPARSE_LIB_BASE_NAME $ ) + else ( ) + set ( SUITESPARSE_LIB_BASE_NAME $ ) + endif ( ) configure_file ( Config/GPUQREngine.pc.in - GPUQREngine.pc + GPUQREngine.pc.out @ONLY NEWLINE_STYLE LF ) + file ( GENERATE + OUTPUT GPUQREngine.pc + INPUT ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngine.pc.out + NEWLINE_STYLE LF ) install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngine.pc DESTINATION ${SUITESPARSE_PKGFILEDIR}/pkgconfig ) diff --git a/SPQR/GPUQREngine/Config/GPUQREngine.pc.in b/SPQR/GPUQREngine/Config/GPUQREngine.pc.in index 2ff8ca6f70..5d73e8647a 100644 --- a/SPQR/GPUQREngine/Config/GPUQREngine.pc.in +++ b/SPQR/GPUQREngine/Config/GPUQREngine.pc.in @@ -7,11 +7,10 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -# FIXME: Which flags do we need to statically link CUDA - Name: GPUQREngine URL: https://github.com/DrTimothyAldenDavis/SuiteSparse Description: GPU-accelerated QR factorization engine supporting SuiteSparseQR in SuiteSparse Version: @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@ -Libs: -L${libdir} -lgpuqrengine@CMAKE_RELEASE_POSTFIX@ +Libs: -L${libdir} -l@SUITESPARSE_LIB_BASE_NAME@ +Libs.private: @GPUQRENGINE_STATIC_LIBS@ Cflags: -I${includedir} diff --git a/SPQR/GPUQREngine/Include/GPUQREngine.hpp b/SPQR/GPUQREngine/Include/GPUQREngine.hpp index 32ce4dca6c..0a1aa869b8 100644 --- a/SPQR/GPUQREngine/Include/GPUQREngine.hpp +++ b/SPQR/GPUQREngine/Include/GPUQREngine.hpp @@ -12,10 +12,10 @@ #define GPUQRENGINE_HPP // Version information: -#define GPUQRENGINE_DATE "Dec 30, 2023" +#define GPUQRENGINE_DATE "Jan 10, 2024" #define GPUQRENGINE_MAIN_VERSION 4 #define GPUQRENGINE_SUB_VERSION 3 -#define GPUQRENGINE_SUBSUB_VERSION 0 +#define GPUQRENGINE_SUBSUB_VERSION 1 #define GPUQRENGINE_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) #define GPUQRENGINE_VERSION \ diff --git a/SPQR/GPUQREngine/Include/GPUQREngine_BucketList.hpp b/SPQR/GPUQREngine/Include/GPUQREngine_BucketList.hpp index 613081a057..8900049bb4 100644 --- a/SPQR/GPUQREngine/Include/GPUQREngine_BucketList.hpp +++ b/SPQR/GPUQREngine/Include/GPUQREngine_BucketList.hpp @@ -21,6 +21,7 @@ #define GPUQRENGINE_BUCKETLIST_HPP #include +#include #include "GPUQREngine_Common.hpp" #include "GPUQREngine_TaskDescriptor.hpp" @@ -74,10 +75,6 @@ template class BucketList int VThead; // Index of the first available entry in VTlist // Constructors - void *operator new(std::size_t, BucketList * p) - { - return p; - } BucketList(Front *f, Int minApplyGranularity); ~BucketList(); @@ -190,7 +187,9 @@ template class BucketList ); }; +#if ! defined (GPUQRENGINE_NO_EXTERN_BUCKETLIST) extern template class BucketList; extern template class BucketList; +#endif #endif diff --git a/SPQR/GPUQREngine/Include/GPUQREngine_Front.hpp b/SPQR/GPUQREngine/Include/GPUQREngine_Front.hpp index e49d0e43a6..604d1a181e 100644 --- a/SPQR/GPUQREngine/Include/GPUQREngine_Front.hpp +++ b/SPQR/GPUQREngine/Include/GPUQREngine_Front.hpp @@ -20,6 +20,7 @@ #define GPUQRENGINE_FRONT_HPP #include +#include #include "GPUQREngine_Common.hpp" #include "GPUQREngine_SparseMeta.hpp" @@ -55,8 +56,6 @@ template class Front /* Debug Fields */ bool printMe; - void* operator new(std::size_t reqMem, Front* ptr){ return ptr; } - Front( Int fids_arg, // the front identifier Int pids_arg, // the parent identifier diff --git a/SPQR/GPUQREngine/Include/GPUQREngine_LLBundle.hpp b/SPQR/GPUQREngine/Include/GPUQREngine_LLBundle.hpp index a04636d5bf..7df9fba994 100644 --- a/SPQR/GPUQREngine/Include/GPUQREngine_LLBundle.hpp +++ b/SPQR/GPUQREngine/Include/GPUQREngine_LLBundle.hpp @@ -25,6 +25,7 @@ #define GPUQRENGINE_LLBUNDLE_HPP #include +#include #include "GPUQREngine_Common.hpp" #include "GPUQREngine_TaskDescriptor.hpp" @@ -78,7 +79,6 @@ template class LLBundle TaskType CurrentTask; - void *operator new(std::size_t, LLBundle * p){ return p; } //------------------------------------------------------------------------------ // // This file contains the constructor and destructor for the LLBundle class. @@ -127,6 +127,9 @@ template class LLBundle void gpuPack(TaskDescriptor *cpuTask); }; +#if ! defined (GPUQRENGINE_NO_EXTERN_LLBUNDLE) extern template class LLBundle; extern template class LLBundle; #endif + +#endif diff --git a/SPQR/GPUQREngine/Include/GPUQREngine_Scheduler.hpp b/SPQR/GPUQREngine/Include/GPUQREngine_Scheduler.hpp index ab02ed5221..5797518fa2 100644 --- a/SPQR/GPUQREngine/Include/GPUQREngine_Scheduler.hpp +++ b/SPQR/GPUQREngine/Include/GPUQREngine_Scheduler.hpp @@ -20,6 +20,7 @@ #define GPUQRENGINE_SCHEDULER_HPP #include +#include #include "GPUQREngine_Common.hpp" #include "GPUQREngine_FrontState.hpp" @@ -99,7 +100,6 @@ class Scheduler cudaStream_t memoryStreamD2H; /* Scheduler.cpp */ - void *operator new(std::size_t, Scheduler * p){ return p; } Scheduler(Front *fronts, Int numFronts, size_t gpuMemorySize); ~Scheduler(); @@ -174,6 +174,9 @@ class Scheduler #endif }; +#if ! defined (GPUQRENGINE_NO_EXTERN_SCHEDULER) extern template class Scheduler; extern template class Scheduler; #endif + +#endif diff --git a/SPQR/GPUQREngine/Include/GPUQREngine_SuiteSparse.hpp b/SPQR/GPUQREngine/Include/GPUQREngine_SuiteSparse.hpp index d3089e045b..fbb9ae239f 100644 --- a/SPQR/GPUQREngine/Include/GPUQREngine_SuiteSparse.hpp +++ b/SPQR/GPUQREngine/Include/GPUQREngine_SuiteSparse.hpp @@ -21,7 +21,7 @@ enum QREngineResultCode { - QRENGINE_SUCCESS, // GPU QR was successfull + QRENGINE_SUCCESS, // GPU QR was successful QRENGINE_OUTOFMEMORY, // GPU QR ran out of memory QRENGINE_GPUERROR // failed to communicated with the GPU }; diff --git a/SPQR/GPUQREngine/Source/BucketList/BucketList.cpp b/SPQR/GPUQREngine/Source/BucketList/BucketList.cpp index 601fc6684f..504169d667 100644 --- a/SPQR/GPUQREngine/Source/BucketList/BucketList.cpp +++ b/SPQR/GPUQREngine/Source/BucketList/BucketList.cpp @@ -31,6 +31,9 @@ Bundles = (LLBundle *) SuiteSparse_free(Bundles); \ gpuVT = (double **) SuiteSparse_free(gpuVT); \ wsMongoVT = Workspace::destroy(wsMongoVT); + +#define GPUQRENGINE_NO_EXTERN_BUCKETLIST + #include "GPUQREngine_BucketList.hpp" template BucketList::BucketList @@ -103,16 +106,6 @@ BucketList::BucketList } } -template BucketList::BucketList -( - Front *F, - int32_t minApplyGranularity -) ; -template BucketList::BucketList -( - Front *F, - int64_t minApplyGranularity -) ; template BucketList::~BucketList() @@ -121,9 +114,6 @@ BucketList::~BucketList() } -template BucketList::~BucketList() ; -template BucketList::~BucketList() ; - template void BucketList::Initialize() @@ -149,5 +139,17 @@ void BucketList::Initialize() } } -template void BucketList::Initialize() ; -template void BucketList::Initialize() ; + +// Instantiate BucketList class template with types int32_t and int64_t +// for export from library. + +#include "BucketList_AdvanceBundles.cpp" +#include "BucketList_CreateBundles.cpp" +#include "BucketList_FillWorkQueue.cpp" +#include "BucketList_GrowBundles.cpp" +#include "BucketList_Manage.cpp" +#include "BucketList_PostProcessing.cpp" + +template class BucketList; +template class BucketList; + diff --git a/SPQR/GPUQREngine/Source/BucketList/BucketList_AdvanceBundles.cpp b/SPQR/GPUQREngine/Source/BucketList/BucketList_AdvanceBundles.cpp index 2cfa05e1a4..2e267f0d39 100644 --- a/SPQR/GPUQREngine/Source/BucketList/BucketList_AdvanceBundles.cpp +++ b/SPQR/GPUQREngine/Source/BucketList/BucketList_AdvanceBundles.cpp @@ -43,6 +43,3 @@ void BucketList::AdvanceBundles() } } } - -template void BucketList::AdvanceBundles() ; -template void BucketList::AdvanceBundles() ; diff --git a/SPQR/GPUQREngine/Source/BucketList/BucketList_CreateBundles.cpp b/SPQR/GPUQREngine/Source/BucketList/BucketList_CreateBundles.cpp index f0fe2b9e3c..ca3d8a654b 100644 --- a/SPQR/GPUQREngine/Source/BucketList/BucketList_CreateBundles.cpp +++ b/SPQR/GPUQREngine/Source/BucketList/BucketList_CreateBundles.cpp @@ -58,15 +58,6 @@ void BucketList::CreateBundles } } -template void BucketList::CreateBundles -( - void -) ; -template void BucketList::CreateBundles -( - void -) ; - // SkipBundleCreation determines whether we should skip creating a new // bundle for the specified tile in the specified column bucket. template @@ -93,17 +84,6 @@ bool BucketList::SkipBundleCreation return false; } -template bool BucketList::SkipBundleCreation -( - int32_t tile, // The tile to consider - int32_t colBucket // The column bucket it sits in -) ; -template bool BucketList::SkipBundleCreation -( - int64_t tile, // The tile to consider - int64_t colBucket // The column bucket it sits in -) ; - // IsInternal determines whether a tile is completely within the bounds // of the front because if it isn't then we will need to use the special // edge case kernels. @@ -133,14 +113,3 @@ bool BucketList::IsInternal Int iLast = TILESIZE * (iTile+1) - 1; return(iLast < front->fm && jLast < front->fn); } - -template bool BucketList::IsInternal -( - LLBundle & Bundle, - int jLast -) ; -template bool BucketList::IsInternal -( - LLBundle & Bundle, - int jLast -) ; diff --git a/SPQR/GPUQREngine/Source/BucketList/BucketList_FillWorkQueue.cpp b/SPQR/GPUQREngine/Source/BucketList/BucketList_FillWorkQueue.cpp index 68b4b1b3c7..937c122bad 100644 --- a/SPQR/GPUQREngine/Source/BucketList/BucketList_FillWorkQueue.cpp +++ b/SPQR/GPUQREngine/Source/BucketList/BucketList_FillWorkQueue.cpp @@ -202,14 +202,3 @@ Int BucketList::FillWorkQueue return numTasks; } - -template int32_t BucketList::FillWorkQueue -( - TaskDescriptor *queue, // The list of work items for the GPU - int32_t *queueIndex // The current index into the queue -) ; -template int64_t BucketList::FillWorkQueue -( - TaskDescriptor *queue, // The list of work items for the GPU - int64_t *queueIndex // The current index into the queue -) ; diff --git a/SPQR/GPUQREngine/Source/BucketList/BucketList_GrowBundles.cpp b/SPQR/GPUQREngine/Source/BucketList/BucketList_GrowBundles.cpp index e39fd6809d..998ac6683b 100644 --- a/SPQR/GPUQREngine/Source/BucketList/BucketList_GrowBundles.cpp +++ b/SPQR/GPUQREngine/Source/BucketList/BucketList_GrowBundles.cpp @@ -72,13 +72,4 @@ void BucketList::GrowBundles } } } - -template void BucketList::GrowBundles -( - void -) ; -template void BucketList::GrowBundles -( - void -) ; #endif diff --git a/SPQR/GPUQREngine/Source/BucketList/BucketList_Manage.cpp b/SPQR/GPUQREngine/Source/BucketList/BucketList_Manage.cpp index 08cf7f7e62..65269e44d6 100644 --- a/SPQR/GPUQREngine/Source/BucketList/BucketList_Manage.cpp +++ b/SPQR/GPUQREngine/Source/BucketList/BucketList_Manage.cpp @@ -39,18 +39,6 @@ void BucketList::Insert /* Keep track of the last bucket. */ LastBucket = MAX(LastBucket, bucket); } -template void BucketList::Insert -( - int32_t tile, - int32_t bucket, - bool upperTriangular -) ; -template void BucketList::Insert -( - int64_t tile, - int64_t bucket, - bool upperTriangular -) ; template void BucketList::Remove @@ -77,17 +65,6 @@ void BucketList::Remove numIdleTiles--; } -template void BucketList::Remove -( - int32_t tile, - int32_t bucket -) ; -template void BucketList::Remove -( - int64_t tile, - int64_t bucket -) ; - #ifdef GPUQRENGINE_PIPELINING template Int BucketList::RemoveHead @@ -99,12 +76,4 @@ Int BucketList::RemoveHead Remove(tile, bucket); return tile; } -template int32_t BucketList::RemoveHead -( - int32_t bucket // The bucket number -) ; -template int64_t BucketList::RemoveHead -( - int64_t bucket // The bucket number -) ; #endif diff --git a/SPQR/GPUQREngine/Source/BucketList/BucketList_PostProcessing.cpp b/SPQR/GPUQREngine/Source/BucketList/BucketList_PostProcessing.cpp index 4164f65505..543b6a5afa 100644 --- a/SPQR/GPUQREngine/Source/BucketList/BucketList_PostProcessing.cpp +++ b/SPQR/GPUQREngine/Source/BucketList/BucketList_PostProcessing.cpp @@ -46,12 +46,3 @@ void BucketList::PostProcess } } } - -template void BucketList::PostProcess -( - void -) ; -template void BucketList::PostProcess -( - void -) ; diff --git a/SPQR/GPUQREngine/Source/GPUQREngine_Internal.cpp b/SPQR/GPUQREngine/Source/GPUQREngine_Internal.cpp index c646ec3d79..5e5fe807a7 100644 --- a/SPQR/GPUQREngine/Source/GPUQREngine_Internal.cpp +++ b/SPQR/GPUQREngine/Source/GPUQREngine_Internal.cpp @@ -124,14 +124,5 @@ template QREngineResultCode GPUQREngine_Internal // via this struct ) ; -template class BucketList; -template class BucketList; - -template class LLBundle; -template class LLBundle; - -template class Scheduler; -template class Scheduler; - #endif diff --git a/SPQR/GPUQREngine/Source/LLBundle/LLBundle.cpp b/SPQR/GPUQREngine/Source/LLBundle/LLBundle.cpp new file mode 100644 index 0000000000..16b17e1239 --- /dev/null +++ b/SPQR/GPUQREngine/Source/LLBundle/LLBundle.cpp @@ -0,0 +1,28 @@ +// ============================================================================= +// === GPUQREngine/Source/LLBundle.cpp ================================ +// ============================================================================= + +// GPUQREngine, Copyright (c) 2024, Timothy A Davis, Sencer Nuri Yeralan, +// and Sanjay Ranka. All Rights Reserved. +// SPDX-License-Identifier: GPL-2.0+ + +//------------------------------------------------------------------------------ +// +// Instantiate LLBundle class template with types int32_t and int64_t +// for export from library. +// +// ============================================================================= + +#define GPUQRENGINE_NO_EXTERN_LLBUNDLE + +#include "GPUQREngine_LLBundle.hpp" +#include "GPUQREngine_BucketList.hpp" + +#include "LLBundle_AddTiles.cpp" +#include "LLBundle_Advance.cpp" +#include "LLBundle_GPUPack.cpp" +#include "LLBundle_PipelinedRearrange.cpp" +#include "LLBundle_UpdateSecondMinIndex.cpp" + +template class LLBundle; +template class LLBundle; diff --git a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_AddTiles.cpp b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_AddTiles.cpp index 734ce8af07..0c97cfc5e1 100644 --- a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_AddTiles.cpp +++ b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_AddTiles.cpp @@ -117,12 +117,3 @@ void LLBundle ::AddTileToSlots /* Update last, if needed. */ if (next[Last] != EMPTY) Last = next[Last]; } - -template void LLBundle ::AddTileToSlots -( - int32_t rowTile -) ; -template void LLBundle ::AddTileToSlots -( - int64_t rowTile -) ; diff --git a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_Advance.cpp b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_Advance.cpp index 15bca9d27d..e5c43e1052 100644 --- a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_Advance.cpp +++ b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_Advance.cpp @@ -83,12 +83,3 @@ bool LLBundle ::Advance return stillAround; } - -template bool LLBundle ::Advance -( - void -) ; -template bool LLBundle ::Advance -( - void -) ; diff --git a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_GPUPack.cpp b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_GPUPack.cpp index bff64c42b3..0ea592ca98 100644 --- a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_GPUPack.cpp +++ b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_GPUPack.cpp @@ -59,12 +59,3 @@ void LLBundle ::gpuPack cpuTask->AuxAddress[0] = VT[0]; cpuTask->AuxAddress[1] = VT[1]; } - -template void LLBundle ::gpuPack -( - TaskDescriptor* cpuTask -) ; -template void LLBundle ::gpuPack -( - TaskDescriptor* cpuTask -) ; diff --git a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_PipelinedRearrange.cpp b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_PipelinedRearrange.cpp index 909344bd92..5aa012fdbc 100644 --- a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_PipelinedRearrange.cpp +++ b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_PipelinedRearrange.cpp @@ -109,12 +109,3 @@ void LLBundle ::PipelinedRearrange while (next[Last] != EMPTY) Last = next[Last]; } } - -template void LLBundle ::PipelinedRearrange -( - void -) ; -template void LLBundle ::PipelinedRearrange -( - void -) ; diff --git a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_UpdateSecondMinIndex.cpp b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_UpdateSecondMinIndex.cpp index 68ae3adde2..441412afc0 100644 --- a/SPQR/GPUQREngine/Source/LLBundle/LLBundle_UpdateSecondMinIndex.cpp +++ b/SPQR/GPUQREngine/Source/LLBundle/LLBundle_UpdateSecondMinIndex.cpp @@ -37,14 +37,6 @@ void LLBundle ::UpdateSecondMinIndex inspect = next[inspect]; } } -template void LLBundle ::UpdateSecondMinIndex -( - void -) ; -template void LLBundle ::UpdateSecondMinIndex -( - void -) ; // ----------------------------------------------------------------------------- // LLBundle::UpdateMax @@ -61,12 +53,3 @@ void LLBundle ::UpdateMax Max = Shadow; for(Int tile=First; tile!=EMPTY; tile=next[tile]) Max = MAX(Max, tile); } - -template void LLBundle ::UpdateMax -( - void -) ; -template void LLBundle ::UpdateMax -( - void -) ; diff --git a/SPQR/GPUQREngine/Source/Scheduler/Scheduler.cpp b/SPQR/GPUQREngine/Source/Scheduler/Scheduler.cpp index 372f2d18a5..306b779f7b 100644 --- a/SPQR/GPUQREngine/Source/Scheduler/Scheduler.cpp +++ b/SPQR/GPUQREngine/Source/Scheduler/Scheduler.cpp @@ -21,10 +21,12 @@ // the constructor is responsible for memory management AND initialization. // ============================================================================= +#define GPUQRENGINE_NO_EXTERN_SCHEDULER +#include "GPUQREngine_Scheduler.hpp" + // ----------------------------------------------------------------------------- // Macro destructor // ----------------------------------------------------------------------------- -#include "GPUQREngine_Scheduler.hpp" #define FREE_EVERYTHING_SCHEDULER \ afPerm = (Int *) SuiteSparse_free(afPerm); \ afPinv = (Int *) SuiteSparse_free(afPinv); \ @@ -159,18 +161,6 @@ Scheduler ::Scheduler renderCount = 0; #endif } -template Scheduler ::Scheduler -( - Front *fronts, - int32_t numFronts, - size_t gpuMemorySize -) ; -template Scheduler ::Scheduler -( - Front *fronts, - int64_t numFronts, - size_t gpuMemorySize -) ; // ----------------------------------------------------------------------------- // Scheduler destructor @@ -180,9 +170,6 @@ Scheduler ::~Scheduler() { FREE_EVERYTHING_SCHEDULER ; } -template Scheduler ::~Scheduler() ; -template Scheduler ::~Scheduler() ; - // ----------------------------------------------------------------------------- // Scheduler::initialize @@ -274,11 +261,16 @@ bool Scheduler ::initialize return cuda_ok; } -template bool Scheduler ::initialize -( - size_t gpuMemorySize -) ; -template bool Scheduler ::initialize -( - size_t gpuMemorySize -) ; +// Instantiate Scheduler class template with types int32_t and int64_t +// for export from library. + +#include "Scheduler_FillWorkQueue.cpp" +#include "Scheduler_Front.cpp" +#include "Scheduler_LaunchKernel.cpp" +#include "Scheduler_PostProcess.cpp" +#include "Scheduler_Render.cpp" +#include "Scheduler_TransferData.cpp" + +template class Scheduler; +template class Scheduler; + diff --git a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_FillWorkQueue.cpp b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_FillWorkQueue.cpp index ef0849c2fe..efa665e345 100644 --- a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_FillWorkQueue.cpp +++ b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_FillWorkQueue.cpp @@ -171,14 +171,6 @@ void Scheduler ::fillWorkQueue #endif } -template void Scheduler ::fillWorkQueue -( - void -) ; -template void Scheduler ::fillWorkQueue -( - void -) ; // ----------------------------------------------------------------------------- // Scheduler::fillTasks // ----------------------------------------------------------------------------- @@ -397,18 +389,7 @@ void Scheduler ::fillTasks /* Copy-out the indexes. */ *queueIndex = qindex; } -template void Scheduler ::fillTasks -( - int32_t f, // INPUT: Current front - TaskDescriptor *queue, // INPUT: CPU Task entries - int32_t *queueIndex // IN/OUT: The index of the current entry -) ; -template void Scheduler ::fillTasks -( - int64_t f, // INPUT: Current front - TaskDescriptor *queue, // INPUT: CPU Task entries - int64_t *queueIndex // IN/OUT: The index of the current entry -) ; + // ----------------------------------------------------------------------------- // buildSAssemblyTask // ----------------------------------------------------------------------------- diff --git a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_Front.cpp b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_Front.cpp index 0375eb60f4..1a143aa79e 100644 --- a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_Front.cpp +++ b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_Front.cpp @@ -29,7 +29,12 @@ // to not accidentally free a front whose R factor is still in transit. // // ============================================================================= + +#include +#include + #include "GPUQREngine_Scheduler.hpp" + // ----------------------------------------------------------------------------- // Scheduler::activateFront // ----------------------------------------------------------------------------- @@ -69,14 +74,7 @@ void Scheduler ::activateFront } } } -template void Scheduler ::activateFront -( - int32_t f // The front id to manipulate -) ; -template void Scheduler ::activateFront -( - int64_t f // The front id to manipulate -) ; + // ----------------------------------------------------------------------------- // Scheduler::pullFrontData // ----------------------------------------------------------------------------- @@ -131,14 +129,6 @@ bool Scheduler ::pullFrontData return (FrontDataPulled[f] = true); } -template bool Scheduler ::pullFrontData -( - int32_t f // The front id to manipulate -) ; -template bool Scheduler ::pullFrontData -( - int64_t f // The front id to manipulate -) ; // ----------------------------------------------------------------------------- // Scheduler::finishFront // ----------------------------------------------------------------------------- @@ -179,14 +169,6 @@ bool Scheduler ::finishFront /* If we got through this method, we have successfully freed the front. */ return true; } -template bool Scheduler ::finishFront -( - int32_t f // The front id to manipulate -) ; -template bool Scheduler ::finishFront -( - int64_t f // The front id to manipulate -) ; #include "GPUQREngine.hpp" // ----------------------------------------------------------------------------- @@ -205,36 +187,39 @@ void Scheduler ::debugDumpFront(Front *front) Int fn = front->fn; wsFront->assign(wsFront->cpu(), front->gpuF); wsFront->transfer(cudaMemcpyDeviceToHost); - printf("--- %g ---\n", (double) (front->fidg)); + std::cout << "--- " << static_cast (front->fidg) << " ---" << std::endl; // for(Int i=0; iassign(wsFront->cpu(), NULL); wsFront = Workspace::destroy(wsFront); } -template void Scheduler ::debugDumpFront(Front *front) ; -template void Scheduler ::debugDumpFront(Front *front) ; #endif diff --git a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_LaunchKernel.cpp b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_LaunchKernel.cpp index e5dd2eb7b8..0b55374d5c 100644 --- a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_LaunchKernel.cpp +++ b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_LaunchKernel.cpp @@ -67,12 +67,3 @@ void Scheduler ::launchKernel /* Clear the number of tasks. */ numTasks[activeSet] = 0; } - -template void Scheduler ::launchKernel -( - void -) ; -template void Scheduler ::launchKernel -( - void -) ; diff --git a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_PostProcess.cpp b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_PostProcess.cpp index 3f2f183eb2..3f437711a1 100644 --- a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_PostProcess.cpp +++ b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_PostProcess.cpp @@ -243,12 +243,3 @@ bool Scheduler ::postProcess /* Return whether all the fronts are DONE. */ return (numFronts == numFrontsCompleted); } - -template bool Scheduler ::postProcess -( - void -) ; -template bool Scheduler ::postProcess -( - void -) ; diff --git a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_Render.cpp b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_Render.cpp index 79dac75ce4..06aebf2f79 100644 --- a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_Render.cpp +++ b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_Render.cpp @@ -99,12 +99,4 @@ void Scheduler ::render fclose(output); } -template void Scheduler ::render -( - void -) ; -template void Scheduler ::render -( - void -) ; #endif diff --git a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_TransferData.cpp b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_TransferData.cpp index 485892a9b8..d8bc8952e4 100644 --- a/SPQR/GPUQREngine/Source/Scheduler/Scheduler_TransferData.cpp +++ b/SPQR/GPUQREngine/Source/Scheduler/Scheduler_TransferData.cpp @@ -64,12 +64,3 @@ void Scheduler ::transferData wsQueueSurgical.transfer(cudaMemcpyHostToDevice, false, memoryStreamH2D); wsQueueSurgical.assign(NULL, NULL); } - -template void Scheduler ::transferData -( - void -) ; -template void Scheduler ::transferData -( - void -) ; diff --git a/SPQR/GPURuntime/CMakeLists.txt b/SPQR/GPURuntime/CMakeLists.txt index b3ab4bcdb5..6d06047144 100644 --- a/SPQR/GPURuntime/CMakeLists.txt +++ b/SPQR/GPURuntime/CMakeLists.txt @@ -23,7 +23,7 @@ message ( STATUS "Building SPQR/GPURUNTIME version: v" project ( suitesparse_gpuruntime VERSION "${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB}" - LANGUAGES C CXX CUDA ) + LANGUAGES CXX ) #------------------------------------------------------------------------------- # SuiteSparse policies @@ -117,9 +117,17 @@ if ( BUILD_STATIC_LIBS ) POSITION_INDEPENDENT_CODE ON CUDA_SEPARABLE_COMPILATION ON CUDA_RUNTIME_LIBRARY Static ) - target_link_libraries ( GPURuntime_static PRIVATE - CUDA::nvrtc CUDA::cudart_static CUDA::cublas ) + target_link_libraries ( GPURuntime_static PRIVATE CUDA::nvrtc CUDA::cudart_static ) target_compile_definitions ( GPURuntime_static PRIVATE "SPQR_HAS_CUDA" ) + # FIXME: Ok to hardcode CUDA library names like this? + set ( GPURUNTIME_STATIC_LIBS "-L${CUDAToolkit_LIBRARY_DIR} -lcuda -lcudart_static" ) + if ( TARGET CUDA::cublas_static ) + target_link_libraries ( GPURuntime_static PRIVATE CUDA::cublas_static ) + set ( GPURUNTIME_STATIC_LIBS "${GPURUNTIME_STATIC_LIBS} -lcublas_static -lcublasLt_static -lculibos" ) + else ( ) + target_link_libraries ( GPURuntime_static PRIVATE CUDA::cublas ) + set ( GPURUNTIME_STATIC_LIBS "${GPURUNTIME_STATIC_LIBS} -lcublas" ) + endif ( ) target_include_directories ( GPURuntime_static INTERFACE $ @@ -190,11 +198,20 @@ if ( NOT MSVC ) else ( ) set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") endif ( ) + if ( BUILD_SHARED_LIBS ) + set ( SUITESPARSE_LIB_BASE_NAME $ ) + else ( ) + set ( SUITESPARSE_LIB_BASE_NAME $ ) + endif ( ) configure_file ( Config/SuiteSparse_GPURuntime.pc.in - SuiteSparse_GPURuntime.pc + SuiteSparse_GPURuntime.pc.out @ONLY NEWLINE_STYLE LF ) + file ( GENERATE + OUTPUT SuiteSparse_GPURuntime.pc + INPUT ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntime.pc.out + NEWLINE_STYLE LF ) install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntime.pc DESTINATION ${SUITESPARSE_PKGFILEDIR}/pkgconfig ) diff --git a/SPQR/GPURuntime/Config/SuiteSparse_GPURuntime.pc.in b/SPQR/GPURuntime/Config/SuiteSparse_GPURuntime.pc.in index 9da6885dd5..45beff71a0 100644 --- a/SPQR/GPURuntime/Config/SuiteSparse_GPURuntime.pc.in +++ b/SPQR/GPURuntime/Config/SuiteSparse_GPURuntime.pc.in @@ -7,12 +7,11 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -# FIXME: Which flags do we need to statically link CUDA - Name: SuiteSparse_GPURuntime URL: https://github.com/DrTimothyAldenDavis/SuiteSparse Description: Helper functions for the GPU in SuiteSparse Version: @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@ Requires.private: SuiteSparse_config -Libs: -L${libdir} -lsuitesparse_gpuruntime@CMAKE_RELEASE_POSTFIX@ +Libs: -L${libdir} -l@SUITESPARSE_LIB_BASE_NAME@ +Libs.private: @GPURUNTIME_STATIC_LIBS@ Cflags: -I${includedir} diff --git a/SPQR/GPURuntime/Include/SuiteSparseGPU_Workspace.hpp b/SPQR/GPURuntime/Include/SuiteSparseGPU_Workspace.hpp index 620404b16d..77c5028d1f 100644 --- a/SPQR/GPURuntime/Include/SuiteSparseGPU_Workspace.hpp +++ b/SPQR/GPURuntime/Include/SuiteSparseGPU_Workspace.hpp @@ -11,6 +11,8 @@ #ifndef SUITESPARSE_GPURUNTIME_WORKSPACE_HPP #define SUITESPARSE_GPURUNTIME_WORKSPACE_HPP +#include + #include "SuiteSparseGPU_internal.hpp" class Workspace @@ -35,7 +37,6 @@ class Workspace void *gpu(void){ return gpuReference; } // Constructor/Destructor - void *operator new(size_t bytes, Workspace* ptr){ return ptr; } Workspace(size_t nitems, size_t size_of_item); ~Workspace(); diff --git a/SPQR/GPURuntime/Include/SuiteSparse_GPURuntime.hpp b/SPQR/GPURuntime/Include/SuiteSparse_GPURuntime.hpp index 8243d80095..6f13ab011a 100644 --- a/SPQR/GPURuntime/Include/SuiteSparse_GPURuntime.hpp +++ b/SPQR/GPURuntime/Include/SuiteSparse_GPURuntime.hpp @@ -12,10 +12,10 @@ #define SUITESPARSE_GPURUNTIME_HPP // Version information: -#define SUITESPARSE_GPURUNTIME_DATE "Dec 30, 2023" +#define SUITESPARSE_GPURUNTIME_DATE "Jan 10, 2024" #define SUITESPARSE_GPURUNTIME_MAIN_VERSION 4 #define SUITESPARSE_GPURUNTIME_SUB_VERSION 3 -#define SUITESPARSE_GPURUNTIME_SUBSUB_VERSION 0 +#define SUITESPARSE_GPURUNTIME_SUBSUB_VERSION 1 #define SUITESPARSE_GPURUNTIME_VER_CODE(main,sub) \ SUITESPARSE_VER_CODE(main,sub) diff --git a/SPQR/Include/SuiteSparseQR_definitions.h b/SPQR/Include/SuiteSparseQR_definitions.h index 54aafa5e97..e2679f2a72 100644 --- a/SPQR/Include/SuiteSparseQR_definitions.h +++ b/SPQR/Include/SuiteSparseQR_definitions.h @@ -64,21 +64,23 @@ #endif */ -#define SPQR_DATE "Dec 30, 2023" +#define SPQR_DATE "Jan 10, 2024" #define SPQR_MAIN_VERSION 4 #define SPQR_SUB_VERSION 3 -#define SPQR_SUBSUB_VERSION 0 +#define SPQR_SUBSUB_VERSION 1 #define SPQR_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define SPQR_VERSION SPQR_VER_CODE(SPQR_MAIN_VERSION,SPQR_SUB_VERSION) +#define SPQR_VERSION SPQR_VER_CODE(4,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "SPQR 4.3.0 requires SuiteSparse_config 7.4.0 or later" +#define SPQR__VERSION SUITESPARSE__VERCODE(4,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "SPQR 4.3.1 requires SuiteSparse_config 7.5.0 or later" #endif -#if (CHOLMOD_VERSION < SUITESPARSE_VER_CODE(5,1)) -#error "SPQR 4.3.0 requires CHOLMOD 5.1.0 or later" +#if !defined (CHOLMOD__VERSION) || \ + (CHOLMOD__VERSION < SUITESPARSE__VERCODE(5,1,1)) +#error "SPQR 4.3.1 requires CHOLMOD 5.1.1 or later" #endif #endif diff --git a/SPQR/MATLAB/spqr_make.m b/SPQR/MATLAB/spqr_make.m index ff0c04b2f6..e240530b3d 100644 --- a/SPQR/MATLAB/spqr_make.m +++ b/SPQR/MATLAB/spqr_make.m @@ -20,45 +20,33 @@ % SPQR, Copyright (c) 2008-2022, Timothy A Davis. All Rights Reserved. % SPDX-License-Identifier: GPL-2.0+ -details = 0 ; % 1 if details of each command are to be printed, 0 if not - -v = version ; -fprintf ('Compiling SuiteSparseQR on MATLAB Version %s\n', v); - -try - % ispc does not appear in MATLAB 5.3 - pc = ispc ; - mac = ismac ; -catch %#ok - % if ispc fails, assume we are on a Windows PC if it's not unix - pc = ~isunix ; - mac = 0 ; +if verLessThan ('matlab', '9.4') + error ('MATLAB 9.4 (R2018a) or later is required') ; end -flags = '' ; -is64 = (~isempty (strfind (computer, '64'))) ; -if (is64) - % 64-bit MATLAB - flags = '-largeArrayDims' ; -else - error ('32-bit version no longer supported') ; -end +details = 0 ; % 1 if details of each command are to be printed, 0 if not -% MATLAB 8.3.0 now has a -silent option to keep 'mex' from burbling too much -if (~verLessThan ('matlab', '8.3.0')) - flags = ['-silent ' flags] ; +% TODO: after removing interleaved complex support, use these flags: +% flags = '-O -R2018a -silent ' ; +% instead of these: +flags = '-O -largeArrayDims -silent ' ; + +if (ispc) + % MSVC does not define ssize_t + flags = [flags ' -DNO_SSIZE_T'] ; end include = '-DNMATRIXOPS -DNMODIFY -I. -I../../AMD/Include -I../../COLAMD/Include -I../../CHOLMOD/Include -I../Include -I../../SuiteSparse_config' ; -% Determine if METIS is available (not available on Windows) -metis_path = '../../CHOLMOD/SuiteSparse_metis' ; -have_metis = exist (metis_path, 'dir') && ~ispc ; - -if (have_metis) - include = [include ' -I' metis_path '/include'] ; - include = [include ' -I' metis_path '/GKlib'] ; - include = [include ' -I' metis_path '/libmetis'] ; +% Determine if METIS is available +if (exist ('../../CHOLMOD/SuiteSparse_metis', 'dir')) + fprintf ('Compiling SPQR with METIS for MATLAB Version %s\n', version) ; + include = [include ' -I../../CHOLMOD/SuiteSparse_metis/include'] ; + include = [include ' -I../../CHOLMOD/SuiteSparse_metis/GKlib'] ; + include = [include ' -I../../CHOLMOD/SuiteSparse_metis/libmetis'] ; +else + fprintf ('Compiling SPQR without METIS for MATLAB Version %s\n', version) ; + include = ['-DNPARTITION ' include] ; end include = [include ' -I../../CCOLAMD/Include -I../../CAMD/Include -I../../CHOLMOD' ] ; @@ -67,20 +55,10 @@ % BLAS option %------------------------------------------------------------------------------- -% This is exceedingly ugly. The MATLAB mex command needs to be told where to -% find the LAPACK and BLAS libraries, which is a real portability nightmare. -% The correct option is highly variable and depends on the MATLAB version. - -if (pc) +if (ispc) % BLAS/LAPACK functions have no underscore on Windows flags = [flags ' -DBLAS_NO_UNDERSCORE'] ; - if (verLessThan ('matlab', '6.5')) - % MATLAB 6.1 and earlier: use the version supplied in CHOLMOD - lib = '../../CHOLMOD/MATLAB/lcc_lib/libmwlapack.lib' ; - elseif (verLessThan ('matlab', '7.5')) - % use the built-in LAPACK lib (which includes the BLAS) - lib = 'libmwlapack.lib' ; - elseif (verLessThan ('matlab', '9.5')) + if (verLessThan ('matlab', '9.5')) lib = 'libmwlapack.lib libmwblas.lib' ; else lib = '-lmwlapack -lmwblas' ; @@ -88,35 +66,16 @@ else % BLAS/LAPACK functions have an underscore suffix flags = [flags ' -DBLAS_UNDERSCORE'] ; - if (verLessThan ('matlab', '7.5')) - % MATLAB 7.5 and earlier, use the LAPACK lib (including the BLAS) - lib = '-lmwlapack' ; - else - % MATLAB 7.6 requires the -lmwblas option; earlier versions do not - lib = '-lmwlapack -lmwblas' ; - end + lib = '-lmwlapack -lmwblas' ; end -if (~verLessThan ('matlab', '7.8')) - % versions 7.8 and later on 64-bit platforms use a 64-bit BLAS - fprintf ('with 64-bit BLAS\n') ; - flags = [flags ' -DBLAS64'] ; -end +flags = [flags ' -DBLAS64'] ; -%------------------------------------------------------------------------------- -% GPU option -%------------------------------------------------------------------------------- - -% GPU not yet supported for the spqr MATLAB mexFunction -% flags = [flags ' -DSPQR_HAS_CUDA'] ; - -if (~(pc || mac)) +if (~(ispc || ismac)) % for POSIX timing routine lib = [lib ' -lrt'] ; end -%------------------------------------------------------------------------------- -% ready to compile ... %------------------------------------------------------------------------------- config_src = { '../../SuiteSparse_config/SuiteSparse_config' } ; @@ -435,7 +394,7 @@ % SuiteSparseQR mexFunctions spqr_mex_cpp_src = { 'spqr', 'spqr_qmult', 'spqr_solve', 'spqr_singletons' } ; -if (pc) +if (ispc) obj_extension = '.obj' ; else obj_extension = '.o' ; diff --git a/SPQR/MATLAB/spqr_mx.cpp b/SPQR/MATLAB/spqr_mx.cpp index 0aeb7d8c00..1b270aa3f7 100644 --- a/SPQR/MATLAB/spqr_mx.cpp +++ b/SPQR/MATLAB/spqr_mx.cpp @@ -963,40 +963,40 @@ mxArray *spqr_mx_info // return a struct with info statistics "nnzR_upper_bound", // 0: nnz(R) bound "nnzH_upper_bound", // 1: nnz(H) bound "number_of_frontal_matrices", // 2: nf - "number_of_TBB_tasks", // 3: ntasks - "rank_A_estimate", // 4: rank - "number_of_column_singletons", // 5: n1cols - "number_of_singleton_rows", // 6: n1rows - "ordering", // 7: ordering used - "memory_usage_in_bytes", // 8: memory usage - "flops_upper_bound", // 9: upper bound on flop count + "rank_A_estimate", // 3: rank + "number_of_column_singletons", // 4: n1cols + "number_of_singleton_rows", // 5: n1rows + "ordering", // 6: ordering used + "memory_usage_in_bytes", // 7: memory usage + "flops_upper_bound", // 8: upper bound on flop count // (excluding backsolve) - "tol", // 10: column norm tolerance used - "number_of_TBB_threads", // 11: # threads used - "norm_E_fro", // 12: norm of dropped diag of R - - // compilation options - "spqr_compiled_with_TBB", // 13: compiled with TBB or not - "spqr_compiled_with_METIS", // 14: compiled with METIS or not + "tol", // 9: column norm tolerance used + "norm_E_fro", // 10: norm of dropped diag of R // only if flops >= 0: - "analyze_time", // 15: analyze time - "factorize_time", // 16: factorize time (and apply Q') - "solve_time", // 17: R\C backsolve only - "total_time", // 18: total x=A\b in seconds - "flops" // 19: actual flops (incl backsolve) + "analyze_time", // 11: analyze time + "factorize_time", // 12: factorize time (and apply Q') + "solve_time", // 13: R\C backsolve only + "total_time", // 14: total x=A\b in seconds + "flops" // 15: actual flops (incl backsolve) } ; - ninfo = (flops < 0) ? 15 : 20 ; + ninfo = (flops < 0) ? 11 : 16 ; s = mxCreateStructMatrix (1, 1, ninfo, info_struct) ; - for (int64_t k = 0 ; k <= 6 ; k++) + for (int64_t k = 0 ; k <= 2 ; k++) { mxSetFieldByNumber (s, 0, k, mxCreateDoubleScalar ((double) cc->SPQR_istat [k])) ; } + for (int64_t k = 3 ; k <= 5 ; k++) + { + mxSetFieldByNumber (s, 0, k, + mxCreateDoubleScalar ((double) cc->SPQR_istat [k+1])) ; + } + // get the ordering used. Note that "default", "best", and "cholmod" // are not among the possible results, since they are meta-orderings // that select among AMD, COLAMD, and/or METIS. @@ -1023,42 +1023,26 @@ mxArray *spqr_mx_info // return a struct with info statistics ord = mxCreateString ("unknown") ; break ; } - mxSetFieldByNumber (s, 0, 7, ord) ; + mxSetFieldByNumber (s, 0, 6, ord) ; - mxSetFieldByNumber (s, 0, 8, + mxSetFieldByNumber (s, 0, 7, mxCreateDoubleScalar ((double) cc->memory_usage)) ; - mxSetFieldByNumber (s, 0, 9, + mxSetFieldByNumber (s, 0, 8, mxCreateDoubleScalar (cc->SPQR_flopcount_bound)) ; - mxSetFieldByNumber (s, 0, 10, mxCreateDoubleScalar (cc->SPQR_tol_used)) ; - - int nthreads = cc->SPQR_nthreads ; - if (nthreads <= 0) - { - mxSetFieldByNumber (s, 0, 11, mxCreateString ("default")); - } - else - { - mxSetFieldByNumber (s, 0, 11, mxCreateDoubleScalar ((double) nthreads)); - } - - mxSetFieldByNumber (s, 0, 12, mxCreateDoubleScalar (cc->SPQR_norm_E_fro)) ; - - // TBB removed - mxSetFieldByNumber (s, 0, 13, mxCreateString ("no")) ; + mxSetFieldByNumber (s, 0, 9, mxCreateDoubleScalar (cc->SPQR_tol_used)) ; - // no need to ask if METIS is available - mxSetFieldByNumber (s, 0, 14, mxCreateString ("(not determined)")) ; + mxSetFieldByNumber (s, 0, 10, mxCreateDoubleScalar (cc->SPQR_norm_E_fro)) ; if (flops >= 0) { - mxSetFieldByNumber (s, 0, 15, + mxSetFieldByNumber (s, 0, 11, mxCreateDoubleScalar (cc->SPQR_analyze_time)) ; - mxSetFieldByNumber (s, 0, 16, + mxSetFieldByNumber (s, 0, 12, mxCreateDoubleScalar (cc->SPQR_factorize_time)) ; - mxSetFieldByNumber (s, 0, 17, + mxSetFieldByNumber (s, 0, 13, mxCreateDoubleScalar (cc->SPQR_solve_time)) ; - mxSetFieldByNumber (s, 0, 18, mxCreateDoubleScalar (t)) ; - mxSetFieldByNumber (s, 0, 19, mxCreateDoubleScalar (flops)) ; + mxSetFieldByNumber (s, 0, 14, mxCreateDoubleScalar (t)) ; + mxSetFieldByNumber (s, 0, 15, mxCreateDoubleScalar (flops)) ; } return (s) ; } diff --git a/SuiteSparse_config/CMakeLists.txt b/SuiteSparse_config/CMakeLists.txt index e9013d6a28..dfc7341cc3 100644 --- a/SuiteSparse_config/CMakeLists.txt +++ b/SuiteSparse_config/CMakeLists.txt @@ -15,9 +15,9 @@ cmake_minimum_required ( VERSION 3.22 ) # version of both SuiteSparse and SuiteSparse_config -set ( SUITESPARSE_DATE "Dec 30, 2023" ) +set ( SUITESPARSE_DATE "Jan 10, 2024" ) set ( SUITESPARSE_VERSION_MAJOR 7 ) -set ( SUITESPARSE_VERSION_MINOR 4 ) +set ( SUITESPARSE_VERSION_MINOR 5 ) 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 ) @@ -53,6 +53,11 @@ else ( ) set ( FortranCInterface_GLOBAL__MACRO ${SUITESPARSE_C_TO_FORTRAN} ) endif ( ) +message ( STATUS "C to Fortran calling protocol: ") +message ( STATUS " SUITESPARSE_HAS_FORTRAN : ${SUITESPARSE_HAS_FORTRAN}" ) +message ( STATUS " FortranCInterface_GLOBAL_MACRO : ${FortranCInterface_GLOBAL_MACRO}" ) +message ( STATUS " FortranCInterface_GLOBAL__MACRO : ${FortranCInterface_GLOBAL__MACRO}" ) + #------------------------------------------------------------------------------- # CUDA warning on Windows with MSVC #------------------------------------------------------------------------------- @@ -70,7 +75,11 @@ if ( NOT SUITESPARSE_USE_OPENMP ) set ( SUITESPARSE_CONFIG_USE_OPENMP "OFF" CACHE STRING "" FORCE ) endif ( ) if ( SUITESPARSE_CONFIG_USE_OPENMP OR SUITESPARSE_USE_OPENMP ) - find_package ( OpenMP GLOBAL ) + if ( CMAKE_VERSION VERSION_LESS 3.24 ) + find_package ( OpenMP COMPONENTS C ) + else ( ) + find_package ( OpenMP COMPONENTS C GLOBAL ) + endif ( ) else ( ) # OpenMP has been disabled set ( OpenMP_C_FOUND OFF ) @@ -171,12 +180,15 @@ endif ( ) #------------------------------------------------------------------------------- # libm: -if ( NOT WIN32 ) +include ( CheckSymbolExists ) +check_symbol_exists ( fmax "math.h" NO_LIBM ) +if ( NOT NO_LIBM ) if ( BUILD_SHARED_LIBS ) target_link_libraries ( SuiteSparseConfig PRIVATE m ) endif ( ) if ( BUILD_STATIC_LIBS ) target_link_libraries ( SuiteSparseConfig_static PUBLIC m ) + list ( APPEND SUITESPARSE_CONFIG_STATIC_LIBS "m" ) endif ( ) endif ( ) @@ -194,6 +206,7 @@ if ( SUITESPARSE_CONFIG_USE_OPENMP ) target_link_libraries ( SuiteSparseConfig_static PRIVATE OpenMP::OpenMP_C ) target_include_directories ( SuiteSparseConfig_static SYSTEM AFTER INTERFACE "$" ) + list ( APPEND SUITESPARSE_CONFIG_STATIC_LIBS ${OpenMP_C_LIBRARIES} ) endif ( ) endif ( ) @@ -263,6 +276,33 @@ install ( FILES #------------------------------------------------------------------------------- if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( SUITESPARSE_CONFIG_STATIC_LIBS_LIST ${SUITESPARSE_CONFIG_STATIC_LIBS} ) + set ( SUITESPARSE_CONFIG_STATIC_LIBS "" ) + foreach ( _lib ${SUITESPARSE_CONFIG_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( SUITESPARSE_CONFIG_STATIC_LIBS "${SUITESPARSE_CONFIG_STATIC_LIBS} -l${_lib}" ) + continue () + endif ( ) + set ( _kinds "SHARED" "STATIC" ) + if ( WIN32 ) + list ( PREPEND _kinds "IMPORT" ) + endif ( ) + foreach ( _kind IN LISTS _kinds ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( SUITESPARSE_CONFIG_STATIC_LIBS "${SUITESPARSE_CONFIG_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) + endforeach ( ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) set ( exec_prefix "\${prefix}" ) cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) diff --git a/SuiteSparse_config/Config/README.md.in b/SuiteSparse_config/Config/README.md.in index 8d1097f263..152f3f3e44 100644 --- a/SuiteSparse_config/Config/README.md.in +++ b/SuiteSparse_config/Config/README.md.in @@ -180,7 +180,7 @@ Packages in SuiteSparse, and files in this directory: CSparse Extended. Includes support for complex matrices and both int or long integers. Use this instead of CSparse for production use; it creates a - libcsparse.so (or *dylib on the Mac) with the same name as CSparse. It is a + libcsparse.so (or dylib on the Mac) with the same name as CSparse. It is a superset of CSparse. Any code that links against CSparse should also be able to link against CXSparse instead. @@ -300,7 +300,7 @@ Packages in SuiteSparse, and files in this directory: author: Tim Davis (all parts) - for spqr_rank: author Les Foster and Tim Davis + for `spqr_rank`: author Les Foster and Tim Davis * `Contents.m` @@ -489,7 +489,7 @@ Thanks for packaging SuiteSparse! Here are some suggestions: * GraphBLAS takes a long time to compile because it creates many fast "FactoryKernels" at compile-time. If you want to reduce the compile time and - library size, enable the GRAPHBLAS_COMPACT mode, but keep the JIT compiler + library size, enable the `GRAPHBLAS_COMPACT` mode, but keep the JIT compiler enabled. Then GraphBLAS will compile the kernels it needs at run-time, via its JIT compiler. Performance will be the same as the FactoryKernels once the JIT kernels are compiled. User compiled kernels are placed in @@ -502,7 +502,7 @@ Thanks for packaging SuiteSparse! Here are some suggestions: * CUDA acceleration: CHOLMOD and SPQR can benefit from their CUDA kernels. If you do not have CUDA or do not want to include it in your distro, this - version of SuiteSparse skips the building of the CHOLMOD_CUDA and SPQR_CUDA + version of SuiteSparse skips the building of the `CHOLMOD_CUDA` and `SPQR_CUDA` libraries, and does not link against the `GPUQREngine` and `SuiteSparse_GPURuntime` libraries. @@ -524,7 +524,7 @@ papers in ACM TOMS, for each package. * For the MATLAB x=A\b, see below for AMD, COLAMD, CHOLMOD, UMFPACK, and SuiteSparseQR (SPQR). -* for GraphBLAS, and `C=A*B` in MATLAB (sparse-times-sparse): +* for GraphBLAS, and C=AB in MATLAB (sparse-times-sparse): T. A. Davis. Algorithm 1037: SuiteSparse:GraphBLAS: Parallel Graph Algorithms in the Language of Sparse Linear Algebra. ACM Trans. Math. Softw. 49, 3, @@ -1184,6 +1184,10 @@ MATLAB/Octave/R/Mathematica interfaces: `p=amd(A)`, `p=colamd(A)`, ... See also Mathematica, R, and many many more. The list is too long. +Julia interface: + + https://github.com/JuliaSparse/SparseArrays.jl + python interface to GraphBLAS by Anaconda and NVIDIA: https://pypi.org/project/python-graphblas diff --git a/SuiteSparse_config/Config/SuiteSparse_config.h.in b/SuiteSparse_config/Config/SuiteSparse_config.h.in index 06cf535f66..70b2de4ff6 100644 --- a/SuiteSparse_config/Config/SuiteSparse_config.h.in +++ b/SuiteSparse_config/Config/SuiteSparse_config.h.in @@ -426,9 +426,14 @@ int SuiteSparse_version // returns SUITESPARSE_VERSION #define SUITESPARSE_SUB_VERSION @SUITESPARSE_VERSION_MINOR@ #define SUITESPARSE_SUBSUB_VERSION @SUITESPARSE_VERSION_SUB@ +// version format x.y #define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub)) -#define SUITESPARSE_VERSION \ - SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION) +#define SUITESPARSE_VERSION SUITESPARSE_VER_CODE(@SUITESPARSE_VERSION_MAJOR@, @SUITESPARSE_VERSION_MINOR@) + +// version format x.y.z +#define SUITESPARSE__VERCODE(main,sub,patch) \ + (((major)*1000ULL + (minor))*1000ULL + (patch)) +#define SUITESPARSE__VERSION SUITESPARSE__VERCODE(@SUITESPARSE_VERSION_MAJOR@,@SUITESPARSE_VERSION_MINOR@,@SUITESPARSE_VERSION_SUB@) //============================================================================== // SuiteSparse interface to the BLAS and LAPACK libraries diff --git a/SuiteSparse_config/Config/SuiteSparse_config.pc.in b/SuiteSparse_config/Config/SuiteSparse_config.pc.in index f83cfc0b03..f082c22602 100644 --- a/SuiteSparse_config/Config/SuiteSparse_config.pc.in +++ b/SuiteSparse_config/Config/SuiteSparse_config.pc.in @@ -12,4 +12,5 @@ URL: https://github.com/DrTimothyAldenDavis/SuiteSparse Description: Configuration for SuiteSparse Version: @SUITESPARSE_VERSION_MAJOR@.@SUITESPARSE_VERSION_MINOR@.@SUITESPARSE_VERSION_SUB@ Libs: -L${libdir} -l@SUITESPARSE_LIB_BASE_NAME@ +Libs.private: @SUITESPARSE_CONFIG_STATIC_LIBS@ Cflags: -I${includedir} diff --git a/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in b/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in index fd1a134fb5..3a40b9d52a 100644 --- a/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in +++ b/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in @@ -41,7 +41,7 @@ set ( _dependencies_found ON ) # Look for OpenMP if ( @SUITESPARSE_HAS_OPENMP@ AND NOT OpenMP_C_FOUND ) - find_dependency ( OpenMP ) + find_dependency ( OpenMP COMPONENTS C ) if ( NOT OpenMP_C_FOUND ) set ( _dependencies_found OFF ) endif ( ) @@ -53,6 +53,7 @@ if ( NOT _dependencies_found ) endif ( ) +# Import target include ( ${CMAKE_CURRENT_LIST_DIR}/SuiteSparse_configTargets.cmake ) if ( @SUITESPARSE_HAS_OPENMP@ ) @@ -80,6 +81,7 @@ if ( @SUITESPARSE_HAS_OPENMP@ ) endif ( ) endif ( ) + # The following is only for backward compatibility with FindSuiteSparse_config. set ( _target_shared SuiteSparse::SuiteSparseConfig ) diff --git a/SuiteSparse_config/README.txt b/SuiteSparse_config/README.txt index 4ff01953f8..9d306c9e2a 100644 --- a/SuiteSparse_config/README.txt +++ b/SuiteSparse_config/README.txt @@ -1,4 +1,4 @@ -SuiteSparse_config, Copyright (c) 2012-2023, Timothy A. Davis. +SuiteSparse_config, Copyright (c) 2012-2024, Timothy A. Davis. All Rights Reserved. SPDX-License-Identifier: BSD-3-clause diff --git a/SuiteSparse_config/SuiteSparse_config.h b/SuiteSparse_config/SuiteSparse_config.h index 05e4506b23..0fd77ab198 100644 --- a/SuiteSparse_config/SuiteSparse_config.h +++ b/SuiteSparse_config/SuiteSparse_config.h @@ -421,14 +421,19 @@ int SuiteSparse_version // returns SUITESPARSE_VERSION #define SUITESPARSE_HAS_VERSION_FUNCTION -#define SUITESPARSE_DATE "Dec 30, 2023" +#define SUITESPARSE_DATE "Jan 10, 2024" #define SUITESPARSE_MAIN_VERSION 7 -#define SUITESPARSE_SUB_VERSION 4 +#define SUITESPARSE_SUB_VERSION 5 #define SUITESPARSE_SUBSUB_VERSION 0 +// version format x.y #define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub)) -#define SUITESPARSE_VERSION \ - SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION) +#define SUITESPARSE_VERSION SUITESPARSE_VER_CODE(7, 5) + +// version format x.y.z +#define SUITESPARSE__VERCODE(main,sub,patch) \ + (((major)*1000ULL + (minor))*1000ULL + (patch)) +#define SUITESPARSE__VERSION SUITESPARSE__VERCODE(7,5,0) //============================================================================== // SuiteSparse interface to the BLAS and LAPACK libraries diff --git a/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake b/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake index ca241472d8..be7cd2e739 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake @@ -36,9 +36,9 @@ if ( DEFINED BLAS_LIBRARIES OR DEFINED BLAS_INCLUDE_DIRS ) # User supplied variables for libraries and/or include directories. # Use them as-is. if ( SUITESPARSE_USE_64BIT_BLAS ) - set ( SuiteSparse_BLAS_integer "int64_t" ) + include ( SuiteSparseBLAS64 ) else ( ) - set ( SuiteSparse_BLAS_integer "int32_t" ) + include ( SuiteSparseBLAS32 ) endif ( ) return ( ) endif ( ) diff --git a/SuiteSparse_config/cmake_modules/SuiteSparseBLAS64.cmake b/SuiteSparse_config/cmake_modules/SuiteSparseBLAS64.cmake index 744aaef910..1a5c636901 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparseBLAS64.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparseBLAS64.cmake @@ -37,7 +37,7 @@ set ( SuiteSparse_BLAS_integer "int64_t" ) # https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/suite-sparse/package.py if ( DEFINED BLAS64_SUFFIX ) - # append BLAS64_SUFFIX to each BLAS and LAPACK name + # append BLAS64_SUFFIX to each BLAS and LAPACK function name string ( FIND ${BLAS64_SUFFIX} "_" HAS_UNDERSCORE ) message ( STATUS "BLAS64_suffix: ${BLAS64_SUFFIX}" ) if ( HAS_UNDERSCORE EQUAL -1 ) diff --git a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake index f2d132aa74..20a7fcf784 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake @@ -247,6 +247,19 @@ message ( STATUS "Build type: ${CMAKE_BUILD_TYPE} ") set ( CMAKE_INCLUDE_CURRENT_DIR ON ) +#------------------------------------------------------------------------------- +# Workaround for math.h on old macOS +#------------------------------------------------------------------------------- + +if ( APPLE AND CMAKE_SYSTEM_VERSION VERSION_LESS 11 ) + # Older versions of math.h on the Mac define Real and Imag, which + # conflict with the internal use of those symbols in CHOLMOD, KLU, SPQR, + # UMFPACK, and ParU. + # This can be disabled with -D__NOEXTENSIONS__ + message ( STATUS "MacOS: disable extensions in math.h" ) + add_compile_definitions ( "__NOEXTENSIONS__" ) +endif ( ) + #------------------------------------------------------------------------------- # check if Fortran is available and enabled #------------------------------------------------------------------------------- diff --git a/TestConfig/AMD/CMakeLists.txt b/TestConfig/AMD/CMakeLists.txt new file mode 100644 index 0000000000..5109972e89 --- /dev/null +++ b/TestConfig/AMD/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/AMD/CMakeLists.txt: cmake for project linking to AMD +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME amd_demo ) +set ( TEST_PACKAGE_NAME AMD ) +set ( TEST_SHARED_BIN amd_demo ) +set ( TEST_STATIC_BIN amd_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::AMD ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::AMD_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/AMD/Makefile.am b/TestConfig/AMD/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/AMD/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/AMD/build/.gitignore b/TestConfig/AMD/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/AMD/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/AMD/configure.ac b/TestConfig/AMD/configure.ac new file mode 100644 index 0000000000..20cf5ec0c3 --- /dev/null +++ b/TestConfig/AMD/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [AMD]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/AMD/demo.cc b/TestConfig/AMD/demo.cc new file mode 100644 index 0000000000..113f58d3b8 --- /dev/null +++ b/TestConfig/AMD/demo.cc @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/AMD/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "amd.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + int64_t Ap[N+1]; + int64_t Ai[NNZ]; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + + int64_t P [N]; + amd_l_order (n, Ap, Ai, P, nullptr, nullptr); + for (int k = 0; k < n; k++) + std::cout << "P [" << k << "] = " << P [k] << std::endl; + + return 0; +} diff --git a/TestConfig/BTF/CMakeLists.txt b/TestConfig/BTF/CMakeLists.txt new file mode 100644 index 0000000000..8e4a26beb8 --- /dev/null +++ b/TestConfig/BTF/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/BTF/CMakeLists.txt: cmake for project linking to BTF +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME btf_demo ) +set ( TEST_PACKAGE_NAME BTF ) +set ( TEST_SHARED_BIN btf_demo ) +set ( TEST_STATIC_BIN btf_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::BTF ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::BTF_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/BTF/Makefile.am b/TestConfig/BTF/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/BTF/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/BTF/build/.gitignore b/TestConfig/BTF/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/BTF/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/BTF/configure.ac b/TestConfig/BTF/configure.ac new file mode 100644 index 0000000000..0437c85f3a --- /dev/null +++ b/TestConfig/BTF/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [BTF]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/BTF/demo.cc b/TestConfig/BTF/demo.cc new file mode 100644 index 0000000000..8a6d852cb0 --- /dev/null +++ b/TestConfig/BTF/demo.cc @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/BTF/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "btf.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + int64_t Ap[N+1]; + int64_t Ai[NNZ]; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + + int64_t P [N]; + double work; + int64_t nmatch; + int64_t Q [N], R [N+1], Work [5*N]; + int64_t nblocks = btf_l_order (n, Ap, Ai, -1, &work, P, Q, R, &nmatch, Work); + for (int k = 0; k < n; k++) + std::cout << "P [" << k << "] = " << P [k] << std::endl; + for (int k = 0; k < n; k++) + std::cout << "Q [" << k << "] = " << Q [k] << std::endl; + std::cout << "nblocks " << nblocks << std::endl; + + return 0; +} diff --git a/TestConfig/CAMD/CMakeLists.txt b/TestConfig/CAMD/CMakeLists.txt new file mode 100644 index 0000000000..3a3e28c6f7 --- /dev/null +++ b/TestConfig/CAMD/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/CAMD/CMakeLists.txt: cmake for project linking to CAMD +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME camd_demo ) +set ( TEST_PACKAGE_NAME CAMD ) +set ( TEST_SHARED_BIN camd_demo ) +set ( TEST_STATIC_BIN camd_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::CAMD ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::CAMD_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/CAMD/Makefile.am b/TestConfig/CAMD/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/CAMD/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/CAMD/build/.gitignore b/TestConfig/CAMD/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/CAMD/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/CAMD/configure.ac b/TestConfig/CAMD/configure.ac new file mode 100644 index 0000000000..b59dc18752 --- /dev/null +++ b/TestConfig/CAMD/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [CAMD]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/CAMD/demo.cc b/TestConfig/CAMD/demo.cc new file mode 100644 index 0000000000..d1f9e2a038 --- /dev/null +++ b/TestConfig/CAMD/demo.cc @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/CAMD/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "camd.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + int64_t Ap[N+1]; + int64_t Ai[NNZ]; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + + int64_t P [N]; + int64_t Cmem [N] ; + for (int k = 0; k < n; k++) + Cmem [k] = 0; + camd_l_order (n, Ap, Ai, P, nullptr, nullptr, Cmem); + for (int k = 0; k < n; k++) + std::cout << "P [" << k << "] = " << P [k] << std::endl; + + return 0; +} diff --git a/TestConfig/CCOLAMD/CMakeLists.txt b/TestConfig/CCOLAMD/CMakeLists.txt new file mode 100644 index 0000000000..bc9ffeb71a --- /dev/null +++ b/TestConfig/CCOLAMD/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/CCOLAMD/CMakeLists.txt: cmake for project linking to CCOLAMD +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME ccolamd_demo ) +set ( TEST_PACKAGE_NAME CCOLAMD ) +set ( TEST_SHARED_BIN ccolamd_demo ) +set ( TEST_STATIC_BIN ccolamd_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::CCOLAMD ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::CCOLAMD_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/CCOLAMD/Makefile.am b/TestConfig/CCOLAMD/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/CCOLAMD/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/CCOLAMD/build/.gitignore b/TestConfig/CCOLAMD/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/CCOLAMD/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/CCOLAMD/configure.ac b/TestConfig/CCOLAMD/configure.ac new file mode 100644 index 0000000000..d79a0feb25 --- /dev/null +++ b/TestConfig/CCOLAMD/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [CCOLAMD]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/CCOLAMD/demo.cc b/TestConfig/CCOLAMD/demo.cc new file mode 100644 index 0000000000..fe6f6c2dfa --- /dev/null +++ b/TestConfig/CCOLAMD/demo.cc @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/CCOLAMD/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "ccolamd.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + int64_t Ap[N+1]; + int64_t Ai[NNZ]; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + + int64_t stats [CCOLAMD_STATS] ; + int64_t P [N+1]; + int64_t Cmem [N] ; + for (int k = 0; k < n; k++) + { + Cmem [k] = 0; + } + int64_t Alen = ccolamd_l_recommended (NNZ, n, n); + int64_t *Awork = (int64_t *) malloc (Alen * sizeof (int64_t)); + memcpy (Awork, Ai, NNZ * sizeof (int64_t)); + memcpy (P, Ap, (N+1) * sizeof (int64_t)); + + int result = ccolamd_l (n, n, Alen, Awork, P, nullptr, stats, Cmem); + ccolamd_l_report (stats) ; + for (int k = 0; k < n; k++) + std::cout << "P [" << k << "] = " << P [k] << std::endl; + free (Awork); + + return ((result == 0) ? 1 : 0) ; +} diff --git a/TestConfig/CHOLMOD/CMakeLists.txt b/TestConfig/CHOLMOD/CMakeLists.txt new file mode 100644 index 0000000000..671764bc3d --- /dev/null +++ b/TestConfig/CHOLMOD/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/CHOLMOD/CMakeLists.txt: cmake for project linking to CHOLMOD +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME cholmod_demo ) +set ( TEST_PACKAGE_NAME CHOLMOD ) +set ( TEST_SHARED_BIN cholmod_demo ) +set ( TEST_STATIC_BIN cholmod_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::CHOLMOD ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::CHOLMOD_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/CHOLMOD/Makefile.am b/TestConfig/CHOLMOD/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/CHOLMOD/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/CHOLMOD/build/.gitignore b/TestConfig/CHOLMOD/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/CHOLMOD/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/CHOLMOD/configure.ac b/TestConfig/CHOLMOD/configure.ac new file mode 100644 index 0000000000..1e739220c5 --- /dev/null +++ b/TestConfig/CHOLMOD/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [CHOLMOD]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/CHOLMOD/demo.cc b/TestConfig/CHOLMOD/demo.cc new file mode 100644 index 0000000000..8332841c09 --- /dev/null +++ b/TestConfig/CHOLMOD/demo.cc @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/CHOLMOD/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "cholmod.h" + +int main (void) +{ + cholmod_common cc; + cholmod_l_start (&cc); + cholmod_l_finish (&cc); + + return 0; +} diff --git a/TestConfig/COLAMD/CMakeLists.txt b/TestConfig/COLAMD/CMakeLists.txt new file mode 100644 index 0000000000..9d19182d32 --- /dev/null +++ b/TestConfig/COLAMD/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/COLAMD/CMakeLists.txt: cmake for project linking to COLAMD +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME colamd_demo ) +set ( TEST_PACKAGE_NAME COLAMD ) +set ( TEST_SHARED_BIN colamd_demo ) +set ( TEST_STATIC_BIN colamd_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::COLAMD ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::COLAMD_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/COLAMD/Makefile.am b/TestConfig/COLAMD/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/COLAMD/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/COLAMD/build/.gitignore b/TestConfig/COLAMD/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/COLAMD/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/COLAMD/configure.ac b/TestConfig/COLAMD/configure.ac new file mode 100644 index 0000000000..81347ebba9 --- /dev/null +++ b/TestConfig/COLAMD/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [COLAMD]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/COLAMD/demo.cc b/TestConfig/COLAMD/demo.cc new file mode 100644 index 0000000000..7c6ae41d9e --- /dev/null +++ b/TestConfig/COLAMD/demo.cc @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/COLAMD/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "colamd.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + int64_t Ap[N+1]; + int64_t Ai[NNZ]; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + + int64_t stats [COLAMD_STATS] ; + int64_t P [N+1]; + int64_t Alen = colamd_l_recommended (NNZ, n, n); + int64_t *Awork = (int64_t *) malloc (Alen * sizeof (int64_t)); + memcpy (Awork, Ai, NNZ * sizeof (int64_t)); + memcpy (P, Ap, (N+1) * sizeof (int64_t)); + int result = colamd_l (n, n, Alen, Awork, P, nullptr, stats); + colamd_l_report (stats) ; + for (int k = 0; k < n; k++) + std::cout << "P [" << k << "] = " << P [k] << std::endl; + free (Awork); + + return ((result == 0) ? 1 : 0) ; +} diff --git a/TestConfig/CXSparse/CMakeLists.txt b/TestConfig/CXSparse/CMakeLists.txt new file mode 100644 index 0000000000..e530634466 --- /dev/null +++ b/TestConfig/CXSparse/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/CXSparse/CMakeLists.txt: cmake for project linking to CXSparse +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME cxsparse_demo ) +set ( TEST_PACKAGE_NAME CXSparse ) +set ( TEST_SHARED_BIN cxsparse_demo ) +set ( TEST_STATIC_BIN cxsparse_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::CXSparse ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::CXSparse_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/CXSparse/Makefile.am b/TestConfig/CXSparse/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/CXSparse/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/CXSparse/build/.gitignore b/TestConfig/CXSparse/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/CXSparse/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/CXSparse/configure.ac b/TestConfig/CXSparse/configure.ac new file mode 100644 index 0000000000..37fa8ff239 --- /dev/null +++ b/TestConfig/CXSparse/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [CXSparse]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/CXSparse/demo.cc b/TestConfig/CXSparse/demo.cc new file mode 100644 index 0000000000..995ad61e5c --- /dev/null +++ b/TestConfig/CXSparse/demo.cc @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/CXSparse/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "cs.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + cs_dl *A = cs_dl_spalloc (n, n, nzmax, true, false); + int64_t *Ap = A->p; + int64_t *Ai = A->i; + double *Ax = A->x; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + Ax [0] = 11.0; + Ax [1] = 21.0; + Ax [2] = 12.0; + Ax [3] = 22.0; + + cs_dl_print (A, false); + cs_dl_spfree (A); + + return 0; +} diff --git a/TestConfig/GraphBLAS/CMakeLists.txt b/TestConfig/GraphBLAS/CMakeLists.txt new file mode 100644 index 0000000000..1171e1f361 --- /dev/null +++ b/TestConfig/GraphBLAS/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/GraphBLAS/CMakeLists.txt: cmake for project linking to GraphBLAS +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME graphblas_demo ) +set ( TEST_PACKAGE_NAME GraphBLAS ) +set ( TEST_SHARED_BIN graphblas_demo ) +set ( TEST_STATIC_BIN graphblas_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::GraphBLAS ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::GraphBLAS_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/GraphBLAS/Makefile.am b/TestConfig/GraphBLAS/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/GraphBLAS/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/GraphBLAS/build/.gitignore b/TestConfig/GraphBLAS/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/GraphBLAS/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/GraphBLAS/configure.ac b/TestConfig/GraphBLAS/configure.ac new file mode 100644 index 0000000000..909e487ede --- /dev/null +++ b/TestConfig/GraphBLAS/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [GraphBLAS]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/GraphBLAS/demo.cc b/TestConfig/GraphBLAS/demo.cc new file mode 100644 index 0000000000..523c5653d3 --- /dev/null +++ b/TestConfig/GraphBLAS/demo.cc @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/GraphBLAS/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "GraphBLAS.h" + +int main (void) +{ + int version [3]; + GrB_init (GrB_NONBLOCKING); + GxB_Global_Option_get (GxB_LIBRARY_VERSION, version); + GrB_finalize (); + + return 0; +} diff --git a/TestConfig/KLU/CMakeLists.txt b/TestConfig/KLU/CMakeLists.txt new file mode 100644 index 0000000000..3331067640 --- /dev/null +++ b/TestConfig/KLU/CMakeLists.txt @@ -0,0 +1,100 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/KLU/CMakeLists.txt: cmake for project linking to KLU +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME klu_demo ) +set ( TEST_PACKAGE_NAME KLU ) +set ( TEST_SHARED_BIN klu_demo ) +set ( TEST_STATIC_BIN klu_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::KLU ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::KLU_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +# libm: +include ( CheckSymbolExists ) +check_symbol_exists ( fmax "math.h" NO_LIBM ) +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) + if ( NOT NO_LIBM ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE "m" ) + endif ( ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) + if ( NOT NO_LIBM ) + target_link_libraries ( ${TEST_STATIC_BIN} PRIVATE "m" ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/KLU/Makefile.am b/TestConfig/KLU/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/KLU/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/KLU/build/.gitignore b/TestConfig/KLU/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/KLU/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/KLU/configure.ac b/TestConfig/KLU/configure.ac new file mode 100644 index 0000000000..2ac8ed9bf9 --- /dev/null +++ b/TestConfig/KLU/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [KLU]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/KLU/demo.cc b/TestConfig/KLU/demo.cc new file mode 100644 index 0000000000..2e4466c19a --- /dev/null +++ b/TestConfig/KLU/demo.cc @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/KLU/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include +#include + +#include "klu.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + int64_t Ap[N+1]; + int64_t Ai[NNZ]; + double Ax[NNZ]; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + Ax [0] = 11.0; + Ax [1] = 21.0; + Ax [2] = 12.0; + Ax [3] = 22.0; + + double b [N] = {8., 45.}; + double xgood [N] = {36.4, -32.7}; + double x [N]; + + klu_l_symbolic *Symbolic; + klu_l_numeric *Numeric; + klu_l_common Common; + klu_l_defaults (&Common); + Symbolic = klu_l_analyze (n, Ap, Ai, &Common); + Numeric = klu_l_factor (Ap, Ai, Ax, Symbolic, &Common); + memcpy (x, b, N * sizeof (double)); + klu_l_solve (Symbolic, Numeric, 5, 1, x, &Common); + klu_l_free_symbolic (&Symbolic, &Common); + klu_l_free_numeric (&Numeric, &Common); + double err = 0; + for (int i = 0; i < n; i++) + { + std::cout << "x [" << i << "] = " << x [i] << std::endl; + err = fmax (err, fabs (x [i] - xgood [i])); + } + std::cout << "error: " << err << std::endl; + + return 0; +} diff --git a/TestConfig/LAGraph/CMakeLists.txt b/TestConfig/LAGraph/CMakeLists.txt new file mode 100644 index 0000000000..b02befd170 --- /dev/null +++ b/TestConfig/LAGraph/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/LAGraph/CMakeLists.txt: cmake for project linking to LAGraph +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME lagraph_demo ) +set ( TEST_PACKAGE_NAME LAGraph ) +set ( TEST_SHARED_BIN lagraph_demo ) +set ( TEST_STATIC_BIN lagraph_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::LAGraph ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::LAGraph_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/LAGraph/Makefile.am b/TestConfig/LAGraph/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/LAGraph/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/LAGraph/build/.gitignore b/TestConfig/LAGraph/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/LAGraph/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/LAGraph/configure.ac b/TestConfig/LAGraph/configure.ac new file mode 100644 index 0000000000..4db3e16b71 --- /dev/null +++ b/TestConfig/LAGraph/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [LAGraph]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/LAGraph/demo.cc b/TestConfig/LAGraph/demo.cc new file mode 100644 index 0000000000..50511c8570 --- /dev/null +++ b/TestConfig/LAGraph/demo.cc @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/LAGraph/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "LAGraph.h" + +int main (void) +{ + int version [3]; + char msg [LAGRAPH_MSG_LEN], verstring [LAGRAPH_MSG_LEN]; + LAGraph_Init (msg); + LAGraph_Version (version, verstring, msg); + LAGraph_Finalize (msg); + + return 0; +} diff --git a/TestConfig/LDL/CMakeLists.txt b/TestConfig/LDL/CMakeLists.txt new file mode 100644 index 0000000000..d929e99038 --- /dev/null +++ b/TestConfig/LDL/CMakeLists.txt @@ -0,0 +1,100 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/LDL/CMakeLists.txt: cmake for project linking to LDL +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME ldl_demo ) +set ( TEST_PACKAGE_NAME LDL ) +set ( TEST_SHARED_BIN ldl_demo ) +set ( TEST_STATIC_BIN ldl_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::LDL ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::LDL_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +# libm: +include ( CheckSymbolExists ) +check_symbol_exists ( fmax "math.h" NO_LIBM ) +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) + if ( NOT NO_LIBM ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE "m" ) + endif ( ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) + if ( NOT NO_LIBM ) + target_link_libraries ( ${TEST_STATIC_BIN} PRIVATE "m" ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/LDL/Makefile.am b/TestConfig/LDL/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/LDL/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/LDL/build/.gitignore b/TestConfig/LDL/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/LDL/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/LDL/configure.ac b/TestConfig/LDL/configure.ac new file mode 100644 index 0000000000..eef0fbe3e7 --- /dev/null +++ b/TestConfig/LDL/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [LDL]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/LDL/demo.cc b/TestConfig/LDL/demo.cc new file mode 100644 index 0000000000..fa37ea9577 --- /dev/null +++ b/TestConfig/LDL/demo.cc @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/LDL/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include +#include + +#include "ldl.h" + +int main (void) +{ + #define N 2 + int64_t n = N; + int64_t P [N]; + + double xgood [N] = {36.4, -32.7}; + double x [N]; + P [0] = 0 ; + P [1] = 1 ; + ldl_l_perm (n, x, xgood, P); + double err = 0; + for (int i = 0; i < n; i++) + { + std::cout << "x2 [" << i << "] = " << x [i] << std::endl; + err = fmax (err, fabs (x [i] - xgood [i])); + } + std::cout << "error: " << err << std::endl; + + return 0; +} diff --git a/TestConfig/Makefile b/TestConfig/Makefile new file mode 100644 index 0000000000..bc2f5aab66 --- /dev/null +++ b/TestConfig/Makefile @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------- +# Makefile for SuiteSparse/TestConfig packages +#------------------------------------------------------------------------------- + +# SuiteSparse/TestConfig, Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +# precede this test with "make local ; make install" in the top-level +# SuiteSparse directory. + +CONFIG = cmake -DCMAKE_PREFIX_PATH="../../lib/cmake" .. +BUILD = cmake --build . --config Release +V = +# V = valgrind --leak-check=full --show-leak-kinds=all + +test: + (cd AMD/build && $(CONFIG) && $(BUILD) && $(V) ./amd_demo && ./amd_demo_static ) + (cd BTF/build && $(CONFIG) && $(BUILD) && $(V) ./btf_demo && ./btf_demo_static ) + (cd CAMD/build && $(CONFIG) && $(BUILD) && $(V) ./camd_demo && ./camd_demo_static ) + (cd CCOLAMD/build && $(CONFIG) && $(BUILD) && $(V) ./ccolamd_demo && ./ccolamd_demo_static ) + (cd CHOLMOD/build && $(CONFIG) && $(BUILD) && $(V) ./cholmod_demo && ./cholmod_demo_static ) + (cd COLAMD/build && $(CONFIG) && $(BUILD) && $(V) ./colamd_demo && ./colamd_demo_static ) + (cd CXSparse/build && $(CONFIG) && $(BUILD) && $(V) ./cxsparse_demo && ./cxsparse_demo_static ) + (cd GraphBLAS/build && $(CONFIG) && $(BUILD) && $(V) ./graphblas_demo && ./graphblas_demo_static ) + (cd KLU/build && $(CONFIG) && $(BUILD) && $(V) ./klu_demo && ./klu_demo_static ) + (cd LAGraph/build && $(CONFIG) && $(BUILD) && $(V) ./lagraph_demo && ./lagraph_demo_static ) + (cd LDL/build && $(CONFIG) && $(BUILD) && $(V) ./ldl_demo && ./ldl_demo_static ) + (cd Mongoose/build && $(CONFIG) && $(BUILD) && $(V) ./mongoose_demo && ./mongoose_demo_static ) + (cd ParU/build && $(CONFIG) && $(BUILD) && $(V) ./paru_demo && ./paru_demo_static ) + (cd RBio/build && $(CONFIG) && $(BUILD) && $(V) ./rbio_demo && ./rbio_demo_static ) + (cd SPEX/build && $(CONFIG) && $(BUILD) && $(V) ./spex_demo && ./spex_demo_static ) + (cd SPQR/build && $(CONFIG) && $(BUILD) && $(V) ./spqr_demo && ./spqr_demo_static ) + (cd UMFPACK/build && $(CONFIG) && $(BUILD) && $(V) ./umfpack_demo && ./umfpack_demo_static ) + (cd SuiteSparse_config/build && $(CONFIG) && $(BUILD) && $(V) ./config_demo && ./config_demo_static ) + +# Remove all files not in the original distribution +distclean: purge + +purge: + - $(RM) -r */build/* + +clean: purge + diff --git a/TestConfig/Mongoose/CMakeLists.txt b/TestConfig/Mongoose/CMakeLists.txt new file mode 100644 index 0000000000..e6c1ae4fbc --- /dev/null +++ b/TestConfig/Mongoose/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/Mongoose/CMakeLists.txt: cmake for project linking to Mongoose +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME mongoose_demo ) +set ( TEST_PACKAGE_NAME SuiteSparse_Mongoose ) +set ( TEST_SHARED_BIN mongoose_demo ) +set ( TEST_STATIC_BIN mongoose_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::Mongoose ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::Mongoose_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/Mongoose/Makefile.am b/TestConfig/Mongoose/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/Mongoose/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/Mongoose/build/.gitignore b/TestConfig/Mongoose/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/Mongoose/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/Mongoose/configure.ac b/TestConfig/Mongoose/configure.ac new file mode 100644 index 0000000000..feb02e3891 --- /dev/null +++ b/TestConfig/Mongoose/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [SuiteSparse_Mongoose]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/Mongoose/demo.cc b/TestConfig/Mongoose/demo.cc new file mode 100644 index 0000000000..509756d427 --- /dev/null +++ b/TestConfig/Mongoose/demo.cc @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/Mongoose/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "Mongoose.hpp" + +int main (void) +{ + // FIXME: Do something more meaningful + std::cout << "Mongoose::mongoose_version(): " << + Mongoose::mongoose_version ( ) << std::endl; + + return 0; +} diff --git a/TestConfig/ParU/CMakeLists.txt b/TestConfig/ParU/CMakeLists.txt new file mode 100644 index 0000000000..b7235aabff --- /dev/null +++ b/TestConfig/ParU/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/ParU/CMakeLists.txt: cmake for project linking to ParU +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME paru_demo ) +set ( TEST_PACKAGE_NAME ParU ) +set ( TEST_SHARED_BIN paru_demo ) +set ( TEST_STATIC_BIN paru_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::ParU ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::ParU_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/ParU/Makefile.am b/TestConfig/ParU/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/ParU/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/ParU/build/.gitignore b/TestConfig/ParU/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/ParU/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/ParU/configure.ac b/TestConfig/ParU/configure.ac new file mode 100644 index 0000000000..88880d4e13 --- /dev/null +++ b/TestConfig/ParU/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [ParU]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/ParU/demo.cc b/TestConfig/ParU/demo.cc new file mode 100644 index 0000000000..8df695f667 --- /dev/null +++ b/TestConfig/ParU/demo.cc @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/ParU/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "ParU.hpp" + +int main (void) +{ + // FIXME: Actually call a function from ParU + + return 0; +} diff --git a/TestConfig/RBio/CMakeLists.txt b/TestConfig/RBio/CMakeLists.txt new file mode 100644 index 0000000000..26997485de --- /dev/null +++ b/TestConfig/RBio/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/RBio/CMakeLists.txt: cmake for project linking to RBio +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME rbio_demo ) +set ( TEST_PACKAGE_NAME RBio ) +set ( TEST_SHARED_BIN rbio_demo ) +set ( TEST_STATIC_BIN rbio_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::RBio ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::RBio_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/RBio/Makefile.am b/TestConfig/RBio/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/RBio/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/RBio/build/.gitignore b/TestConfig/RBio/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/RBio/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/RBio/configure.ac b/TestConfig/RBio/configure.ac new file mode 100644 index 0000000000..7806958e6f --- /dev/null +++ b/TestConfig/RBio/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [RBio]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/RBio/demo.cc b/TestConfig/RBio/demo.cc new file mode 100644 index 0000000000..e84035cbfc --- /dev/null +++ b/TestConfig/RBio/demo.cc @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/RBio/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "RBio.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + int64_t Ap[N+1]; + int64_t Ai[NNZ]; + double Ax[NNZ]; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + Ax [0] = 11.0; + Ax [1] = 21.0; + Ax [2] = 12.0; + Ax [3] = 22.0; + + char mtype [4]; + std::string key {"simple"}; + std::string title {"2-by-2 matrix"}; + mtype [0] = '\0'; + int64_t njumbled, nzeros; + int result = RBok (n, n, NNZ, Ap, Ai, Ax, nullptr, nullptr, 0, &njumbled, &nzeros); + std::cout << "njumbled " << njumbled << ", nzeros " << nzeros << std::endl; + std::string filename {"temp.rb"}; + result = RBwrite (filename.c_str (), title.c_str (), key.c_str (), n, n, + Ap, Ai, Ax, nullptr, nullptr, nullptr, 0, mtype); + std::cout << "result " << result << std::endl; + std::cout << "mtype: " << mtype << std::endl; + + // dump out the file + FILE *f = fopen ("temp.rb", "r"); + int c; + while (1) + { + c = fgetc (f); + if (c == EOF) + break; + fputc (c, stdout); + } + fclose (f) ; + + return 0; +} diff --git a/TestConfig/README.md b/TestConfig/README.md new file mode 100644 index 0000000000..cdbe23aa03 --- /dev/null +++ b/TestConfig/README.md @@ -0,0 +1,21 @@ +SuiteSparse/TestConfig: test `*Config.make` for each package in SuiteSparse + +Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +SPDX-License-Identifier: BSD-3-clause + +This folder provides a test for each `*Config.cmake` for each package. + +To run this test, first build and install all of SuiteSparse. In the top-level +folder, do: + + make local + make install + +Next, in this directory: + + make + +To remove files not in the original distribution, do: + + make clean + diff --git a/TestConfig/SPEX/CMakeLists.txt b/TestConfig/SPEX/CMakeLists.txt new file mode 100644 index 0000000000..da58d85b68 --- /dev/null +++ b/TestConfig/SPEX/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/SPEX/CMakeLists.txt: cmake for project linking to SPEX +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME spex_demo ) +set ( TEST_PACKAGE_NAME SPEX ) +set ( TEST_SHARED_BIN spex_demo ) +set ( TEST_STATIC_BIN spex_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::SPEX ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::SPEX_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/SPEX/Makefile.am b/TestConfig/SPEX/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/SPEX/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/SPEX/build/.gitignore b/TestConfig/SPEX/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/SPEX/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/SPEX/configure.ac b/TestConfig/SPEX/configure.ac new file mode 100644 index 0000000000..0125de8363 --- /dev/null +++ b/TestConfig/SPEX/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [SPEX]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/SPEX/demo.cc b/TestConfig/SPEX/demo.cc new file mode 100644 index 0000000000..f18372ae03 --- /dev/null +++ b/TestConfig/SPEX/demo.cc @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/SPEX/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "SPEX.h" + +int main (void) +{ + SPEX_initialize ( ); + SPEX_finalize ( ); + + return 0; +} diff --git a/TestConfig/SPQR/CMakeLists.txt b/TestConfig/SPQR/CMakeLists.txt new file mode 100644 index 0000000000..7b6cecfb76 --- /dev/null +++ b/TestConfig/SPQR/CMakeLists.txt @@ -0,0 +1,97 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/SPQR/CMakeLists.txt: cmake for project linking to SPQR +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME spqr_demo ) +set ( TEST_PACKAGE_NAME SPQR ) +set ( TEST_SHARED_BIN spqr_demo ) +set ( TEST_STATIC_BIN spqr_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::SPQR ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::SPQR_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE SuiteSparse::CHOLMOD ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) + if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC SuiteSparse::CHOLMOD_static ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC SuiteSparse::CHOLMOD ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/SPQR/Makefile.am b/TestConfig/SPQR/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/SPQR/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/SPQR/build/.gitignore b/TestConfig/SPQR/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/SPQR/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/SPQR/configure.ac b/TestConfig/SPQR/configure.ac new file mode 100644 index 0000000000..b0093482bf --- /dev/null +++ b/TestConfig/SPQR/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [SPQR CHOLMOD]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/SPQR/demo.cc b/TestConfig/SPQR/demo.cc new file mode 100644 index 0000000000..347b905c57 --- /dev/null +++ b/TestConfig/SPQR/demo.cc @@ -0,0 +1,82 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/SPQR/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "SuiteSparseQR_C.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + int64_t Ap[N+1]; + int64_t Ai[NNZ]; + double Ax[NNZ]; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + Ax [0] = 11.0; + Ax [1] = 21.0; + Ax [2] = 12.0; + Ax [3] = 22.0; + + double b [N] = {8., 45.}; + + cholmod_sparse *A, A_struct; + cholmod_dense *B, B_struct; + cholmod_dense *X; + + // make a shallow CHOLMOD copy of A + A = &A_struct; + A->nrow = n; + A->ncol = n; + A->p = Ap; + A->i = Ai; + A->x = Ax; + A->z = nullptr; + A->nzmax = NNZ; + A->packed = true; + A->sorted = true; + A->nz = nullptr; + A->itype = CHOLMOD_LONG; + A->dtype = CHOLMOD_DOUBLE; + A->xtype = CHOLMOD_REAL; + A->stype = 0; + + // make a shallow CHOLMOD copy of b + B = &B_struct; + B->nrow = n; + B->ncol = 1; + B->x = b; + B->z = nullptr; + B->d = n; + B->nzmax = n; + B->dtype = CHOLMOD_DOUBLE; + B->xtype = CHOLMOD_REAL; + + cholmod_common cc; + cholmod_l_start (&cc); + + X = SuiteSparseQR_C_backslash_default (A, B, &cc); + cc.print = 5 ; + cholmod_l_print_dense (X, "X from QR", &cc); + cholmod_l_free_dense (&X, &cc) ; + + cholmod_l_finish (&cc); + + return 0; +} diff --git a/TestConfig/SuiteSparse_config/CMakeLists.txt b/TestConfig/SuiteSparse_config/CMakeLists.txt new file mode 100644 index 0000000000..8702ac52f7 --- /dev/null +++ b/TestConfig/SuiteSparse_config/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/SuiteSparse_config/CMakeLists.txt: cmake for project linking to SuiteSparse_config +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME config_demo ) +set ( TEST_PACKAGE_NAME SuiteSparse_config ) +set ( TEST_SHARED_BIN config_demo ) +set ( TEST_STATIC_BIN config_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::SuiteSparseConfig ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::SuiteSparseConfig_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/SuiteSparse_config/Makefile.am b/TestConfig/SuiteSparse_config/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/SuiteSparse_config/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/SuiteSparse_config/build/.gitignore b/TestConfig/SuiteSparse_config/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/SuiteSparse_config/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/SuiteSparse_config/configure.ac b/TestConfig/SuiteSparse_config/configure.ac new file mode 100644 index 0000000000..8f131f6dce --- /dev/null +++ b/TestConfig/SuiteSparse_config/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [SuiteSparse_config]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/SuiteSparse_config/demo.cc b/TestConfig/SuiteSparse_config/demo.cc new file mode 100644 index 0000000000..9db0827726 --- /dev/null +++ b/TestConfig/SuiteSparse_config/demo.cc @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/SuiteSparse_config/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "SuiteSparse_config.h" + +int main (void) +{ + int version [3]; + SuiteSparse_version (version); + std::cout << "SuiteSparse_config version: " << version[0] << "." + << version[1] << "." << version[2] << std::endl; + + return 0; +} diff --git a/TestConfig/UMFPACK/CMakeLists.txt b/TestConfig/UMFPACK/CMakeLists.txt new file mode 100644 index 0000000000..7094042c51 --- /dev/null +++ b/TestConfig/UMFPACK/CMakeLists.txt @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/TestConfig/UMFPACK/CMakeLists.txt: cmake for project linking to UMFPACK +#------------------------------------------------------------------------------- + +# Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +cmake_minimum_required ( VERSION 3.22 ) + +#------------------------------------------------------------------------------- +# configure options +#------------------------------------------------------------------------------- + +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) +option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + +#------------------------------------------------------------------------------- +# variables +#------------------------------------------------------------------------------- + +set ( TEST_PROJECT_NAME umfpack_demo ) +set ( TEST_PACKAGE_NAME UMFPACK ) +set ( TEST_SHARED_BIN umfpack_demo ) +set ( TEST_STATIC_BIN umfpack_demo_static ) +set ( TEST_IMPORT_TARGET SuiteSparse::UMFPACK ) +set ( TEST_IMPORT_TARGET_STATIC SuiteSparse::UMFPACK_static ) + +#------------------------------------------------------------------------------- +# define project +#------------------------------------------------------------------------------- + +project ( ${TEST_PROJECT_NAME} LANGUAGES C CXX ) + +#------------------------------------------------------------------------------- +# find library dependencies +#------------------------------------------------------------------------------- + +find_package ( ${TEST_PACKAGE_NAME} REQUIRED ) + +#------------------------------------------------------------------------------- +# dynamically linked executable properties +#------------------------------------------------------------------------------- + +file ( GLOB MY_SOURCES "*.cc" ) +if ( BUILD_SHARED_LIBS ) + add_executable ( ${TEST_SHARED_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_SHARED_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# staticcally linked executable properties +#------------------------------------------------------------------------------- + +if ( BUILD_STATIC_LIBS ) + add_executable ( ${TEST_STATIC_BIN} ${MY_SOURCES} ) + set_target_properties ( ${TEST_STATIC_BIN} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON ) +endif ( ) + +#------------------------------------------------------------------------------- +# add library dependency +#------------------------------------------------------------------------------- + +if ( BUILD_SHARED_LIBS ) + target_link_libraries ( ${TEST_SHARED_BIN} PRIVATE ${TEST_IMPORT_TARGET} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + if ( TARGET ${TEST_IMPORT_TARGET_STATIC} ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET_STATIC} ) + else ( ) + target_link_libraries ( ${TEST_STATIC_BIN} PUBLIC ${TEST_IMPORT_TARGET} ) + endif ( ) +endif ( ) + +#------------------------------------------------------------------------------- +# installation location +#------------------------------------------------------------------------------- + +include ( GNUInstallDirs ) + +if ( BUILD_SHARED_LIBS ) + install ( TARGETS ${TEST_SHARED_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) +if ( BUILD_STATIC_LIBS ) + install ( TARGETS ${TEST_STATIC_BIN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif ( ) diff --git a/TestConfig/UMFPACK/Makefile.am b/TestConfig/UMFPACK/Makefile.am new file mode 100644 index 0000000000..8bf37d3f0f --- /dev/null +++ b/TestConfig/UMFPACK/Makefile.am @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Example/.../Makefile +#------------------------------------------------------------------------------- + +# Example: Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +#------------------------------------------------------------------------------- + +demo_PROGRAMS = \ + %reldir%/suitesparse_demo + +demodir = %canon_reldir% + +%canon_reldir%_suitesparse_demo_SOURCES = %reldir%/demo.cc +%canon_reldir%_suitesparse_demo_CPPFLAGS = @SUITESPARSE_CFLAGS@ +%canon_reldir%_suitesparse_demo_LDADD = @SUITESPARSE_LIBS@ diff --git a/TestConfig/UMFPACK/build/.gitignore b/TestConfig/UMFPACK/build/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/TestConfig/UMFPACK/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/TestConfig/UMFPACK/configure.ac b/TestConfig/UMFPACK/configure.ac new file mode 100644 index 0000000000..012f24028e --- /dev/null +++ b/TestConfig/UMFPACK/configure.ac @@ -0,0 +1,25 @@ +# simple configure file for example project in SuiteSparse + +# initialize +AC_INIT([example], [1.6.0]) + +AM_INIT_AUTOMAKE([foreign subdir-objects]) + +LT_INIT + +# check for working compilers +AC_PROG_CXX + +# find pkg-config executable +PKG_PROG_PKG_CONFIG() + +if test "$enable_static" = yes; then + PKG_CONFIG="$PKG_CONFIG --static" +fi + +# find installed SuiteSparse library +PKG_CHECK_MODULES([SUITESPARSE], [UMFPACK]) + +# create Makefile.in from Makefile.am +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/TestConfig/UMFPACK/demo.cc b/TestConfig/UMFPACK/demo.cc new file mode 100644 index 0000000000..15cd544d0a --- /dev/null +++ b/TestConfig/UMFPACK/demo.cc @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// SuiteSparse/TestConfig/UMFPACK/demo.cc +//------------------------------------------------------------------------------ + +// Copyright (c) 2024, Timothy A. Davis, All Rights Reserved. +// SPDX-License-Identifier: BSD-3-clause + +//------------------------------------------------------------------------------ + +// TestConfig program + +#include + +#include "umfpack.h" + +int main (void) +{ + #define N 2 + #define NNZ 4 + int64_t n = N; + int64_t nzmax = NNZ; + int64_t Ap[N+1]; + int64_t Ai[NNZ]; + double Ax[NNZ]; + Ap [0] = 0; + Ap [1] = 2; + Ap [2] = NNZ; + Ai [0] = 0; + Ai [1] = 1; + Ai [2] = 0; + Ai [3] = 1; + Ax [0] = 11.0; + Ax [1] = 21.0; + Ax [2] = 12.0; + Ax [3] = 22.0; + + double b [N] = {8., 45.}; + double xgood [N] = {36.4, -32.7} ; + double x [N] ; + + double Control [UMFPACK_CONTROL] ; + double Info [UMFPACK_INFO] ; + umfpack_dl_defaults (Control) ; + Control [UMFPACK_PRL] = 6 ; + + void *Sym, *Num; + (void) umfpack_dl_symbolic (n, n, Ap, Ai, Ax, &Sym, Control, Info); + (void) umfpack_dl_numeric (Ap, Ai, Ax, Sym, &Num, Control, Info); + umfpack_dl_free_symbolic (&Sym); + int result = umfpack_dl_solve (UMFPACK_A, Ap, Ai, Ax, x, b, Num, Control, Info); + umfpack_dl_free_numeric (&Num); + for (int i = 0 ; i < n ; i++) + std::cout << "x [" << i << "] = " << x [i] << std::endl; + double err = 0; + for (int i = 0; i < n; i++) + { + err = fmax (err, fabs (x [i] - xgood [i])); + } + std::cout << "error: " << err << std::endl; + + umfpack_dl_report_status (Control, result) ; + umfpack_dl_report_info (Control, Info) ; + + return 0; +} diff --git a/UMFPACK/CMakeLists.txt b/UMFPACK/CMakeLists.txt index 065aa6be4d..4d715bf7c4 100644 --- a/UMFPACK/CMakeLists.txt +++ b/UMFPACK/CMakeLists.txt @@ -12,10 +12,10 @@ # cmake 3.22 is required to find the BLAS in SuiteSparse_config cmake_minimum_required ( VERSION 3.22 ) -set ( UMFPACK_DATE "Dec 30, 2023" ) +set ( UMFPACK_DATE "Jan 10, 2024" ) set ( UMFPACK_VERSION_MAJOR 6 CACHE STRING "" FORCE ) set ( UMFPACK_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( UMFPACK_VERSION_SUB 0 CACHE STRING "" FORCE ) +set ( UMFPACK_VERSION_SUB 1 CACHE STRING "" FORCE ) message ( STATUS "Building UMFPACK version: v" ${UMFPACK_VERSION_MAJOR}. @@ -45,16 +45,16 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) - find_package ( SuiteSparse_config 7.4.0 + find_package ( SuiteSparse_config 7.5.0 PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) - find_package ( SuiteSparse_config 7.4.0 REQUIRED ) + find_package ( SuiteSparse_config 7.5.0 REQUIRED ) endif ( ) - find_package ( AMD 3.3.0 + find_package ( AMD 3.3.1 PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::AMD ) - find_package ( AMD 3.3.0 REQUIRED ) + find_package ( AMD 3.3.1 REQUIRED ) endif ( ) endif ( ) @@ -73,10 +73,10 @@ if ( SUITESPARSE_ROOT_CMAKELISTS ) else ( ) if ( UMFPACK_USE_CHOLMOD ) # look for CHOLMOD (optional fill-reducing orderings) - find_package ( CHOLMOD 5.1.0 + find_package ( CHOLMOD 5.1.1 PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::CHOLMOD ) - find_package ( CHOLMOD 5.1.0 ) + find_package ( CHOLMOD 5.1.1 ) endif ( ) if ( NOT CHOLMOD_FOUND ) # CHOLMOD not found so disable it @@ -228,7 +228,9 @@ else ( ) endif ( ) # libm: -if ( NOT WIN32 ) +include ( CheckSymbolExists ) +check_symbol_exists ( fmax "math.h" NO_LIBM ) +if ( NOT NO_LIBM ) if ( BUILD_SHARED_LIBS ) target_link_libraries ( UMFPACK PRIVATE m ) endif ( ) @@ -252,6 +254,186 @@ if ( BUILD_STATIC_LIBS ) target_include_directories ( UMFPACK_static PRIVATE ${BLAS_INCLUDE_DIRS} ) endif ( ) +#------------------------------------------------------------------------------- +# check compiler features +#------------------------------------------------------------------------------- + +include ( CheckSourceCompiles ) + +set ( _orig_CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ) +include ( CheckCCompilerFlag ) +check_c_compiler_flag ( "-Wunknown-pragmas" HAVE_UNKNOWN_PRAGMAS ) +if ( HAVE_UNKNOWN_PRAGMAS ) + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunknown-pragmas" ) +endif ( ) + +# check syntax for ivdep pragma +set ( _pragma_found OFF ) +# GCC compatible +check_source_compiles ( C + "int main(void) { + #pragma GCC ivdep + for (int j = 0; j < 1; j++) { } + return 0; + }" + HAVE_PRAGMA_GCC_IVDEP + FAIL_REGEX "[wW]arning" ) + +if ( HAVE_PRAGMA_GCC_IVDEP ) + if ( BUILD_SHARED_LIBS ) + target_compile_definitions ( UMFPACK PRIVATE "HAVE_PRAGMA_GCC_IVDEP" ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_compile_definitions ( UMFPACK_static PRIVATE "HAVE_PRAGMA_GCC_IVDEP" ) + endif ( ) + set ( _pragma_found ON ) +endif ( ) + +# Clang compatible +if ( NOT _pragma_found ) + check_source_compiles ( C + "int main(void) { + #pragma clang loop vectorize(enable) + for (int j = 0; j < 1; j++) { } + return 0; + }" + HAVE_PRAGMA_CLANG_LOOP_VECTORIZE + FAIL_REGEX "[wW]arning" ) + + if ( HAVE_PRAGMA_CLANG_LOOP_VECTORIZE ) + # Clang is very verbose if a hint for vectorization cannot be performed. + # Disable the respective warning. + check_c_compiler_flag ( "-Wno-pass-failed" HAVE_NO_PASS_FAILED ) + if ( BUILD_SHARED_LIBS ) + target_compile_definitions ( UMFPACK PRIVATE "HAVE_PRAGMA_CLANG_LOOP_VECTORIZE" ) + if ( HAVE_NO_PASS_FAILED ) + target_compile_options ( UMFPACK PRIVATE "-Wno-pass-failed" ) + endif ( ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_compile_definitions ( UMFPACK_static PRIVATE "HAVE_PRAGMA_CLANG_LOOP_VECTORIZE" ) + if ( HAVE_NO_PASS_FAILED ) + target_compile_options ( UMFPACK_static PRIVATE "-Wno-pass-failed" ) + endif ( ) + endif ( ) + set ( _pragma_found ON ) + endif ( ) +endif ( ) + +# Intel compatible +if ( NOT _pragma_found ) + check_source_compiles ( C + "int main(void) { + #pragma ivdep + for (int j = 0; j < 1; j++) { } + return 0; + }" + HAVE_PRAGMA_IVDEP + FAIL_REGEX "[wW]arning" ) + + if ( HAVE_PRAGMA_IVDEP ) + if ( BUILD_SHARED_LIBS ) + target_compile_definitions ( UMFPACK PRIVATE "HAVE_PRAGMA_IVDEP" ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_compile_definitions ( UMFPACK_static PRIVATE "HAVE_PRAGMA_IVDEP" ) + endif ( ) + set ( _pragma_found ON ) + endif ( ) +endif ( ) + +# MSVC compatible +if ( NOT _pragma_found ) + check_source_compiles ( C + "int main(void) { + #pragma loop( ivdep ) + for (int j = 0; j < 1; j++) { } + return 0; + }" + HAVE_PRAGMA_LOOP_IVDEP + FAIL_REGEX "[wW]arning" ) + + if ( HAVE_PRAGMA_LOOP_IVDEP ) + if ( BUILD_SHARED_LIBS ) + target_compile_definitions ( UMFPACK PRIVATE "HAVE_PRAGMA_LOOP_IVDEP" ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_compile_definitions ( UMFPACK_static PRIVATE "HAVE_PRAGMA_LOOP_IVDEP" ) + endif ( ) + set ( _pragma_found ON ) + endif ( ) +endif ( ) + +# check syntax for novector pragma +set ( _pragma_found ${HAVE_PRAGMA_CLANG_LOOP_VECTORIZE} ) +# GCC compatible +if ( NOT _pragma_found ) + check_source_compiles ( C + "int main(void) { + #pragma GCC novector + for (int j = 0; j < 1; j++) { } + return 0; + }" + HAVE_PRAGMA_GCC_NOVECTOR + FAIL_REGEX "[wW]arning" ) + + if ( HAVE_PRAGMA_GCC_NOVECTOR ) + if ( BUILD_SHARED_LIBS ) + target_compile_definitions ( UMFPACK PRIVATE "HAVE_PRAGMA_GCC_NOVECTOR" ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_compile_definitions ( UMFPACK_static PRIVATE "HAVE_PRAGMA_GCC_NOVECTOR" ) + endif ( ) + set ( _pragma_found ON ) + endif ( ) +endif ( ) + +# Intel compatible +if ( NOT _pragma_found ) + check_source_compiles ( C + "int main(void) { + #pragma novector + for (int j = 0; j < 1; j++) { } + return 0; + }" + HAVE_PRAGMA_NOVECTOR + FAIL_REGEX "[wW]arning" ) + + if ( HAVE_PRAGMA_NOVECTOR ) + if ( BUILD_SHARED_LIBS ) + target_compile_definitions ( UMFPACK PRIVATE "HAVE_PRAGMA_NOVECTOR" ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_compile_definitions ( UMFPACK_static PRIVATE "HAVE_PRAGMA_NOVECTOR" ) + endif ( ) + set ( _pragma_found ON ) + endif ( ) +endif ( ) + +# MSVC compatible +if ( NOT _pragma_found ) + check_source_compiles ( C + "int main(void) { + #pragma loop( no_vector ) + for (int j = 0; j < 1; j++) { } + return 0; + }" + HAVE_PRAGMA_LOOP_NO_VECTOR + FAIL_REGEX "[wW]arning" ) + + if ( HAVE_PRAGMA_LOOP_NO_VECTOR ) + if ( BUILD_SHARED_LIBS ) + target_compile_definitions ( UMFPACK PRIVATE "HAVE_PRAGMA_LOOP_NO_VECTOR" ) + endif ( ) + if ( BUILD_STATIC_LIBS ) + target_compile_definitions ( UMFPACK_static PRIVATE "HAVE_PRAGMA_LOOP_NO_VECTOR" ) + endif ( ) + set ( _pragma_found ON ) + endif ( ) +endif ( ) + +set ( CMAKE_C_FLAGS ${_orig_CMAKE_C_FLAGS} ) + #------------------------------------------------------------------------------- # UMFPACK installation location #------------------------------------------------------------------------------- diff --git a/UMFPACK/Config/UMFPACK.pc.in b/UMFPACK/Config/UMFPACK.pc.in index 2a3c58b608..3efcf7c8a1 100644 --- a/UMFPACK/Config/UMFPACK.pc.in +++ b/UMFPACK/Config/UMFPACK.pc.in @@ -1,4 +1,4 @@ -# UMFPACK, Copyright (c) 1995-2023, Timothy A. Davis. +# UMFPACK, Copyright (c) 1995-2024, Timothy A. Davis. # All Rights Reserved. # SPDX-License-Identifier: GPL-2.0-or-later diff --git a/UMFPACK/Config/UMFPACKConfig.cmake.in b/UMFPACK/Config/UMFPACKConfig.cmake.in index 10c4c11226..fc9fbf6d6c 100644 --- a/UMFPACK/Config/UMFPACKConfig.cmake.in +++ b/UMFPACK/Config/UMFPACKConfig.cmake.in @@ -4,7 +4,7 @@ # The following copyright and license applies to just this file only, not to # the library itself: -# UMFPACKConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# UMFPACKConfig.cmake, Copyright (c) 2023-2024, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- @@ -92,6 +92,8 @@ if ( NOT SuiteSparse_config_FOUND OR NOT AMD_FOUND return ( ) endif ( ) + +# Import target include ( ${CMAKE_CURRENT_LIST_DIR}/UMFPACKTargets.cmake ) # The following is only for backward compatibility with FindUMFPACK. diff --git a/UMFPACK/Config/umfpack.h.in b/UMFPACK/Config/umfpack.h.in index 336aad2175..0e78985b52 100644 --- a/UMFPACK/Config/umfpack.h.in +++ b/UMFPACK/Config/umfpack.h.in @@ -2,7 +2,7 @@ // UMFPACK/Include/umfpack.h: include file for UMFPACK //------------------------------------------------------------------------------ -// UMFPACK, Copyright (c) 2005-2023, Timothy A. Davis, All Rights Reserved. +// UMFPACK, Copyright (c) 2005-2024, Timothy A. Davis, All Rights Reserved. // SPDX-License-Identifier: GPL-2.0+ //------------------------------------------------------------------------------ @@ -40,7 +40,7 @@ /* -------------------------------------------------------------------------- */ #define UMFPACK_COPYRIGHT \ -"UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved.\n" +"UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved.\n" #define UMFPACK_LICENSE_PART1 \ "\nUMFPACK License: SPDX-License-Identifier: GPL-2.0+\n" \ @@ -80,15 +80,17 @@ #define UMFPACK_SUBSUB_VERSION @UMFPACK_VERSION_SUB@ #define UMFPACK_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define UMFPACK_VER UMFPACK_VER_CODE(UMFPACK_MAIN_VERSION,UMFPACK_SUB_VERSION) +#define UMFPACK_VER UMFPACK_VER_CODE(@UMFPACK_VERSION_MAJOR@,@UMFPACK_VERSION_MINOR@) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "UMFPACK @UMFPACK_VERSION_MAJOR@.@UMFPACK_VERSION_MINOR@.@UMFPACK_VERSION_SUB@ requires SuiteSparse_config 7.4.0 or later" +#define UMFPACK__VERSION SUITESPARSE__VERCODE(@UMFPACK_VERSION_MAJOR@,@UMFPACK_VERSION_MINOR@,@UMFPACK_VERSION_SUB@) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "UMFPACK @UMFPACK_VERSION_MAJOR@.@UMFPACK_VERSION_MINOR@.@UMFPACK_VERSION_SUB@ requires SuiteSparse_config 7.5.0 or later" #endif -#if AMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "UMFPACK @UMFPACK_VERSION_MAJOR@.@UMFPACK_VERSION_MINOR@.@UMFPACK_VERSION_SUB@ requires AMD 3.3.0 or later" +#if !defined (AMD__VERSION) || \ + (AMD__VERSION < SUITESPARSE__VERCODE(3,3,1)) +#error "UMFPACK @UMFPACK_VERSION_MAJOR@.@UMFPACK_VERSION_MINOR@.@UMFPACK_VERSION_SUB@ requires AMD 3.1.1 or later" #endif // user code should not directly use GB_STR or GB_XSTR diff --git a/UMFPACK/Demo/umf4hb.out b/UMFPACK/Demo/umf4hb.out index befc9542ba..950011c08c 100644 --- a/UMFPACK/Demo/umf4hb.out +++ b/UMFPACK/Demo/umf4hb.out @@ -1,4 +1,4 @@ -UMFPACK V6.3.0 (Dec 30, 2023), Control: +UMFPACK V6.3.1 (Jan 10, 2024), Control: Matrix entry defined as: double Int (generic integer) defined as: int32_t @@ -33,17 +33,17 @@ UMFPACK V6.3.0 (Dec 30, 2023), Control: The following options can only be changed at compile-time: 8: BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 compiled for ANSI C - SuiteSparse_time ( ) + CPU timer: SuiteSparse_time ( ) compiled with CHOLMOD ordering options computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 4 pointer: 8 double: 8 Entry: 8 (in bytes) -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 67 number of columns in matrix A: 67 entries in matrix A: 294 @@ -106,8 +106,8 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: numeric factorization defragmentations: 1 numeric factorization reallocations: 1 costly numeric factorization reallocations: 1 - numeric factorization wallclock time (sec): 0.04 - numeric factorization mflops (wallclock): 0.07 + numeric factorization wallclock time (sec): 0.01 + numeric factorization mflops (wallclock): 0.33 solve flops: 1.20800e+03 iterative refinement steps taken: 0 @@ -119,7 +119,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: Matrix key: WEST0067 symbolic analysis: status: 0. - time: 0.18E-03 (sec) + time: 0.10E-03 (sec) estimates (upper bound) for numeric LU: size of LU: 0.02 (MB) memory needed: 0.06 (MB) @@ -128,7 +128,7 @@ symbolic analysis: nnz (U): 902. numeric factorization: status: 0. - time: 0.38E-01 + time: 0.78E-02 actual numeric LU statistics: size of LU: 0.01 (MB) memory needed: 0.04 (MB) diff --git a/UMFPACK/Demo/umf4hb64.out b/UMFPACK/Demo/umf4hb64.out index 2595a951db..e166c353f4 100644 --- a/UMFPACK/Demo/umf4hb64.out +++ b/UMFPACK/Demo/umf4hb64.out @@ -1,4 +1,4 @@ -UMFPACK V6.3.0 (Dec 30, 2023), Control: +UMFPACK V6.3.1 (Jan 10, 2024), Control: Matrix entry defined as: double Int (generic integer) defined as: int64_t @@ -33,17 +33,17 @@ UMFPACK V6.3.0 (Dec 30, 2023), Control: The following options can only be changed at compile-time: 8: BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 compiled for ANSI C - SuiteSparse_time ( ) + CPU timer: SuiteSparse_time ( ) compiled with CHOLMOD ordering options computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 8 pointer: 8 double: 8 Entry: 8 (in bytes) -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 67 number of columns in matrix A: 67 entries in matrix A: 294 @@ -106,8 +106,8 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: numeric factorization defragmentations: 1 numeric factorization reallocations: 1 costly numeric factorization reallocations: 1 - numeric factorization wallclock time (sec): 0.03 - numeric factorization mflops (wallclock): 0.08 + numeric factorization wallclock time (sec): 0.02 + numeric factorization mflops (wallclock): 0.10 solve flops: 1.20800e+03 iterative refinement steps taken: 0 @@ -119,7 +119,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: Matrix key: WEST0067 symbolic analysis: status: 0. - time: 0.20E-03 (sec) + time: 0.11E-03 (sec) estimates (upper bound) for numeric LU: size of LU: 0.02 (MB) memory needed: 0.08 (MB) @@ -128,7 +128,7 @@ symbolic analysis: nnz (U): 902. numeric factorization: status: 0. - time: 0.35E-01 + time: 0.25E-01 actual numeric LU statistics: size of LU: 0.01 (MB) memory needed: 0.06 (MB) diff --git a/UMFPACK/Demo/umf4zhb.out b/UMFPACK/Demo/umf4zhb.out index 5f0a670a81..8f09393c9d 100644 --- a/UMFPACK/Demo/umf4zhb.out +++ b/UMFPACK/Demo/umf4zhb.out @@ -1,4 +1,4 @@ -UMFPACK V6.3.0 (Dec 30, 2023), Control: +UMFPACK V6.3.1 (Jan 10, 2024), Control: Matrix entry defined as: double complex Int (generic integer) defined as: int32_t @@ -33,17 +33,17 @@ UMFPACK V6.3.0 (Dec 30, 2023), Control: The following options can only be changed at compile-time: 8: BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 compiled for ANSI C - SuiteSparse_time ( ) + CPU timer: SuiteSparse_time ( ) compiled with CHOLMOD ordering options computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 4 pointer: 8 double: 8 Entry: 16 (in bytes) -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 324 number of columns in matrix A: 324 entries in matrix A: 26730 @@ -119,10 +119,10 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: numeric factorization defragmentations: 0 numeric factorization reallocations: 0 costly numeric factorization reallocations: 0 - numeric factorization wallclock time (sec): 0.14 - numeric factorization mflops (wallclock): 102.27 - symbolic + numeric wall clock time (sec): 0.14 - symbolic + numeric mflops (wall clock): 99.78 + numeric factorization wallclock time (sec): 0.02 + numeric factorization mflops (wallclock): 829.51 + symbolic + numeric wall clock time (sec): 0.02 + symbolic + numeric mflops (wall clock): 750.24 solve flops: 3.70332e+05 iterative refinement steps taken: 0 @@ -134,7 +134,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: Matrix key: QC324 symbolic analysis: status: 0. - time: 0.35E-02 (sec) + time: 0.18E-02 (sec) estimates (upper bound) for numeric LU: size of LU: 1.17 (MB) memory needed: 2.40 (MB) @@ -143,11 +143,11 @@ symbolic analysis: nnz (U): 39609. numeric factorization: status: 0. - time: 0.14E+00 + time: 0.17E-01 actual numeric LU statistics: size of LU: 0.72 (MB) memory needed: 1.14 (MB) flop count: 0.14E+08 nnz (L): 23247. nnz (U): 23247. - norm (A*x-b): 2.7082234386269613E-013 + norm (A*x-b): 2.7037543144102808E-013 diff --git a/UMFPACK/Demo/umf4zhb64.out b/UMFPACK/Demo/umf4zhb64.out index c8773d1e00..9f0bcb9f6f 100644 --- a/UMFPACK/Demo/umf4zhb64.out +++ b/UMFPACK/Demo/umf4zhb64.out @@ -1,4 +1,4 @@ -UMFPACK V6.3.0 (Dec 30, 2023), Control: +UMFPACK V6.3.1 (Jan 10, 2024), Control: Matrix entry defined as: double complex Int (generic integer) defined as: int64_t @@ -33,17 +33,17 @@ UMFPACK V6.3.0 (Dec 30, 2023), Control: The following options can only be changed at compile-time: 8: BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 compiled for ANSI C - SuiteSparse_time ( ) + CPU timer: SuiteSparse_time ( ) compiled with CHOLMOD ordering options computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 8 pointer: 8 double: 8 Entry: 16 (in bytes) -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 324 number of columns in matrix A: 324 entries in matrix A: 26730 @@ -119,10 +119,10 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: numeric factorization defragmentations: 0 numeric factorization reallocations: 0 costly numeric factorization reallocations: 0 - numeric factorization wallclock time (sec): 0.29 - numeric factorization mflops (wallclock): 50.19 - symbolic + numeric wall clock time (sec): 0.29 - symbolic + numeric mflops (wall clock): 49.53 + numeric factorization wallclock time (sec): 0.03 + numeric factorization mflops (wallclock): 432.53 + symbolic + numeric wall clock time (sec): 0.04 + symbolic + numeric mflops (wall clock): 405.69 solve flops: 3.70332e+05 iterative refinement steps taken: 0 @@ -134,7 +134,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: Matrix key: QC324 symbolic analysis: status: 0. - time: 0.38E-02 (sec) + time: 0.22E-02 (sec) estimates (upper bound) for numeric LU: size of LU: 1.37 (MB) memory needed: 2.97 (MB) @@ -143,11 +143,11 @@ symbolic analysis: nnz (U): 39609. numeric factorization: status: 0. - time: 0.29E+00 + time: 0.33E-01 actual numeric LU statistics: size of LU: 0.74 (MB) memory needed: 1.38 (MB) flop count: 0.14E+08 nnz (L): 23247. nnz (U): 23247. - norm (A*x-b): 2.7082234386269613E-013 + norm (A*x-b): 2.7037543144102808E-013 diff --git a/UMFPACK/Demo/umfpack_di_demo.out b/UMFPACK/Demo/umfpack_di_demo.out index c58ad99e3e..fb465c0a78 100644 --- a/UMFPACK/Demo/umfpack_di_demo.out +++ b/UMFPACK/Demo/umfpack_di_demo.out @@ -1,7 +1,7 @@ -UMFPACK V6.3 (Dec 30, 2023) demo: _di_ version +UMFPACK V6.3 (Jan 10, 2024) demo: _di_ version -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. UMFPACK License: SPDX-License-Identifier: GPL-2.0+ @@ -10,9 +10,9 @@ UMFPACK License: SPDX-License-Identifier: GPL-2.0+ Availability: http://www.suitesparse.com -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK -UMFPACK V6.3.0 (Dec 30, 2023), Control: +UMFPACK V6.3.1 (Jan 10, 2024), Control: Matrix entry defined as: double Int (generic integer) defined as: int32_t @@ -47,7 +47,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Control: The following options can only be changed at compile-time: 8: BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 compiled for ANSI C - SuiteSparse_time ( ) + CPU timer: SuiteSparse_time ( ) compiled with CHOLMOD ordering options computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 4 pointer: 8 double: 8 Entry: 8 (in bytes) @@ -257,12 +257,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -344,9 +344,9 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: total symbolic + numeric + solve flops: 1.25000e+02 -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK x (solution of Ax=b): dense vector, n = 5. @@ -360,9 +360,9 @@ x (solution of Ax=b): dense vector, n = 5. maxnorm of residual: 1.06581e-14 -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK determinant: (1.14) * 10^(2) @@ -376,12 +376,12 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.06581e-14 -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -605,12 +605,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -852,12 +852,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1300,12 +1300,12 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1509,12 +1509,12 @@ Done copying numeric object Numeric blob size: 752 Done serialize/deserialize of numeric object -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1607,12 +1607,12 @@ maxnorm of residual: 3.55271e-15 Solving C'x=b again, using umfpack_di_wsolve instead: -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1705,4 +1705,4 @@ maxnorm of residual: 3.55271e-15 umfpack_di_demo complete. -Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) +Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) diff --git a/UMFPACK/Demo/umfpack_dl_demo.out b/UMFPACK/Demo/umfpack_dl_demo.out index 099ddda274..ef89628379 100644 --- a/UMFPACK/Demo/umfpack_dl_demo.out +++ b/UMFPACK/Demo/umfpack_dl_demo.out @@ -1,7 +1,7 @@ -UMFPACK V6.3 (Dec 30, 2023) demo: _dl_ version +UMFPACK V6.3 (Jan 10, 2024) demo: _dl_ version -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. UMFPACK License: SPDX-License-Identifier: GPL-2.0+ @@ -10,9 +10,9 @@ UMFPACK License: SPDX-License-Identifier: GPL-2.0+ Availability: http://www.suitesparse.com -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK -UMFPACK V6.3.0 (Dec 30, 2023), Control: +UMFPACK V6.3.1 (Jan 10, 2024), Control: Matrix entry defined as: double Int (generic integer) defined as: int64_t @@ -47,7 +47,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Control: The following options can only be changed at compile-time: 8: BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 compiled for ANSI C - SuiteSparse_time ( ) + CPU timer: SuiteSparse_time ( ) compiled with CHOLMOD ordering options computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 8 pointer: 8 double: 8 Entry: 8 (in bytes) @@ -257,12 +257,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -344,9 +344,9 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: total symbolic + numeric + solve flops: 1.25000e+02 -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK x (solution of Ax=b): dense vector, n = 5. @@ -360,9 +360,9 @@ x (solution of Ax=b): dense vector, n = 5. maxnorm of residual: 1.06581e-14 -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK determinant: (1.14) * 10^(2) @@ -376,12 +376,12 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.06581e-14 -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -605,12 +605,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -852,12 +852,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1300,12 +1300,12 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1509,12 +1509,12 @@ Done copying numeric object Numeric blob size: 1144 Done serialize/deserialize of numeric object -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1607,12 +1607,12 @@ maxnorm of residual: 3.55271e-15 Solving C'x=b again, using umfpack_dl_wsolve instead: -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1705,4 +1705,4 @@ maxnorm of residual: 3.55271e-15 umfpack_dl_demo complete. -Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) +Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) diff --git a/UMFPACK/Demo/umfpack_zi_demo.out b/UMFPACK/Demo/umfpack_zi_demo.out index 32fa41519a..649aebfea8 100644 --- a/UMFPACK/Demo/umfpack_zi_demo.out +++ b/UMFPACK/Demo/umfpack_zi_demo.out @@ -1,7 +1,7 @@ -UMFPACK V6.3 (Dec 30, 2023) demo: _zi_ version +UMFPACK V6.3 (Jan 10, 2024) demo: _zi_ version -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. UMFPACK License: SPDX-License-Identifier: GPL-2.0+ @@ -10,9 +10,9 @@ UMFPACK License: SPDX-License-Identifier: GPL-2.0+ Availability: http://www.suitesparse.com -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK -UMFPACK V6.3.0 (Dec 30, 2023), Control: +UMFPACK V6.3.1 (Jan 10, 2024), Control: Matrix entry defined as: double complex Int (generic integer) defined as: int32_t @@ -47,7 +47,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Control: The following options can only be changed at compile-time: 8: BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 compiled for ANSI C - SuiteSparse_time ( ) + CPU timer: SuiteSparse_time ( ) compiled with CHOLMOD ordering options computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 4 pointer: 8 double: 8 Entry: 16 (in bytes) @@ -257,12 +257,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -332,7 +332,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 - numeric factorization mflops (wallclock): 0.01 + numeric factorization mflops (wallclock): 0.02 solve flops: 1.02800e+03 iterative refinement steps taken: 1 @@ -344,9 +344,9 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: total symbolic + numeric + solve flops: 1.06200e+03 -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK x (solution of Ax=b): dense vector, n = 5. @@ -360,9 +360,9 @@ x (solution of Ax=b): dense vector, n = 5. maxnorm of residual: 1.77636e-15 -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK determinant: (-1.7814+ (2.3784)i) * 10^(2) @@ -376,12 +376,12 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.77636e-14 -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -451,7 +451,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 - numeric factorization mflops (wallclock): 0.01 + numeric factorization mflops (wallclock): 0.02 solve flops: 4.80000e+02 iterative refinement steps taken: 0 @@ -605,12 +605,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -852,12 +852,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1300,12 +1300,12 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1509,12 +1509,12 @@ Done copying numeric object Numeric blob size: 864 Done serialize/deserialize of numeric object -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1607,12 +1607,12 @@ maxnorm of residual: 4.88498e-15 Solving C'x=b again, using umfpack_zi_wsolve instead: -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1705,4 +1705,4 @@ maxnorm of residual: 4.88498e-15 umfpack_zi_demo complete. -Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) +Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) diff --git a/UMFPACK/Demo/umfpack_zl_demo.out b/UMFPACK/Demo/umfpack_zl_demo.out index 3c22d0e10b..73eb9f3bc7 100644 --- a/UMFPACK/Demo/umfpack_zl_demo.out +++ b/UMFPACK/Demo/umfpack_zl_demo.out @@ -1,7 +1,7 @@ -UMFPACK V6.3 (Dec 30, 2023) demo: _zl_ version +UMFPACK V6.3 (Jan 10, 2024) demo: _zl_ version -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. UMFPACK License: SPDX-License-Identifier: GPL-2.0+ @@ -10,9 +10,9 @@ UMFPACK License: SPDX-License-Identifier: GPL-2.0+ Availability: http://www.suitesparse.com -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK -UMFPACK V6.3.0 (Dec 30, 2023), Control: +UMFPACK V6.3.1 (Jan 10, 2024), Control: Matrix entry defined as: double complex Int (generic integer) defined as: int64_t @@ -47,7 +47,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Control: The following options can only be changed at compile-time: 8: BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 compiled for ANSI C - SuiteSparse_time ( ) + CPU timer: SuiteSparse_time ( ) compiled with CHOLMOD ordering options computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 8 pointer: 8 double: 8 Entry: 16 (in bytes) @@ -257,12 +257,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -332,7 +332,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 - numeric factorization mflops (wallclock): 0.01 + numeric factorization mflops (wallclock): 0.02 solve flops: 1.02800e+03 iterative refinement steps taken: 1 @@ -344,9 +344,9 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: total symbolic + numeric + solve flops: 1.06200e+03 -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK x (solution of Ax=b): dense vector, n = 5. @@ -360,9 +360,9 @@ x (solution of Ax=b): dense vector, n = 5. maxnorm of residual: 1.77636e-15 -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. +UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.3.0 (Dec 30, 2023): OK +UMFPACK V6.3.1 (Jan 10, 2024): OK determinant: (-1.7814+ (2.3784)i) * 10^(2) @@ -376,12 +376,12 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.77636e-14 -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -451,7 +451,7 @@ UMFPACK V6.3.0 (Dec 30, 2023), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 - numeric factorization mflops (wallclock): 0.01 + numeric factorization mflops (wallclock): 0.02 solve flops: 4.80000e+02 iterative refinement steps taken: 0 @@ -605,12 +605,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -852,12 +852,12 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1300,12 +1300,12 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1509,12 +1509,12 @@ Done copying numeric object Numeric blob size: 1208 Done serialize/deserialize of numeric object -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1607,12 +1607,12 @@ maxnorm of residual: 4.88498e-15 Solving C'x=b again, using umfpack_zl_wsolve instead: -UMFPACK V6.3.0 (Dec 30, 2023), Info: +UMFPACK V6.3.1 (Jan 10, 2024), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. + MATLAB: no. + CPU timer: SuiteSparse_time ( ) number of rows in matrix A: 5 number of columns in matrix A: 5 entries in matrix A: 12 @@ -1705,4 +1705,4 @@ maxnorm of residual: 4.88498e-15 umfpack_zl_demo complete. -Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) +Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) diff --git a/UMFPACK/Doc/ChangeLog b/UMFPACK/Doc/ChangeLog index 605165d787..54d2dc97e0 100644 --- a/UMFPACK/Doc/ChangeLog +++ b/UMFPACK/Doc/ChangeLog @@ -1,3 +1,8 @@ +Jan 10, 2024: version 6.3.1 + + * MATLAB interface: add -DNO_SSIZE_T for Windows + * minor updates to build system + Dec 30, 2023: version 6.3.0 * major change to build system: by Markus Mützel diff --git a/UMFPACK/Doc/UMFPACK_QuickStart.pdf b/UMFPACK/Doc/UMFPACK_QuickStart.pdf index 0705a7dcb4..5ec66b4652 100644 Binary files a/UMFPACK/Doc/UMFPACK_QuickStart.pdf and b/UMFPACK/Doc/UMFPACK_QuickStart.pdf differ diff --git a/UMFPACK/Doc/UMFPACK_UserGuide.pdf b/UMFPACK/Doc/UMFPACK_UserGuide.pdf index 3532b8f3f4..abcf7850b2 100644 Binary files a/UMFPACK/Doc/UMFPACK_UserGuide.pdf and b/UMFPACK/Doc/UMFPACK_UserGuide.pdf differ diff --git a/UMFPACK/Doc/umfpack_version.tex b/UMFPACK/Doc/umfpack_version.tex index e565684a71..1c66a1e4e6 100644 --- a/UMFPACK/Doc/umfpack_version.tex +++ b/UMFPACK/Doc/umfpack_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/UMFPACK -\date{VERSION 6.3.0, Dec 30, 2023} +\date{VERSION 6.3.1, Jan 10, 2024} diff --git a/UMFPACK/Include/umfpack.h b/UMFPACK/Include/umfpack.h index 67cded2156..2f1a9932d1 100644 --- a/UMFPACK/Include/umfpack.h +++ b/UMFPACK/Include/umfpack.h @@ -2,7 +2,7 @@ // UMFPACK/Include/umfpack.h: include file for UMFPACK //------------------------------------------------------------------------------ -// UMFPACK, Copyright (c) 2005-2023, Timothy A. Davis, All Rights Reserved. +// UMFPACK, Copyright (c) 2005-2024, Timothy A. Davis, All Rights Reserved. // SPDX-License-Identifier: GPL-2.0+ //------------------------------------------------------------------------------ @@ -40,7 +40,7 @@ /* -------------------------------------------------------------------------- */ #define UMFPACK_COPYRIGHT \ -"UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved.\n" +"UMFPACK: Copyright (c) 2005-2024 by Timothy A. Davis. All Rights Reserved.\n" #define UMFPACK_LICENSE_PART1 \ "\nUMFPACK License: SPDX-License-Identifier: GPL-2.0+\n" \ @@ -74,21 +74,23 @@ * below. */ -#define UMFPACK_DATE "Dec 30, 2023" +#define UMFPACK_DATE "Jan 10, 2024" #define UMFPACK_MAIN_VERSION 6 #define UMFPACK_SUB_VERSION 3 -#define UMFPACK_SUBSUB_VERSION 0 +#define UMFPACK_SUBSUB_VERSION 1 #define UMFPACK_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub) -#define UMFPACK_VER UMFPACK_VER_CODE(UMFPACK_MAIN_VERSION,UMFPACK_SUB_VERSION) +#define UMFPACK_VER UMFPACK_VER_CODE(6,3) -#if !defined (SUITESPARSE_VERSION) || \ - (SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4)) -#error "UMFPACK 6.3.0 requires SuiteSparse_config 7.4.0 or later" +#define UMFPACK__VERSION SUITESPARSE__VERCODE(6,3,1) +#if !defined (SUITESPARSE__VERSION) || \ + (SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)) +#error "UMFPACK 6.3.1 requires SuiteSparse_config 7.5.0 or later" #endif -#if AMD_VERSION < SUITESPARSE_VER_CODE(3,3) -#error "UMFPACK 6.3.0 requires AMD 3.3.0 or later" +#if !defined (AMD__VERSION) || \ + (AMD__VERSION < SUITESPARSE__VERCODE(3,3,1)) +#error "UMFPACK 6.3.1 requires AMD 3.1.1 or later" #endif // user code should not directly use GB_STR or GB_XSTR diff --git a/UMFPACK/MATLAB/umfpack_make.m b/UMFPACK/MATLAB/umfpack_make.m index 4f0ee83ea3..5cdbdc5083 100644 --- a/UMFPACK/MATLAB/umfpack_make.m +++ b/UMFPACK/MATLAB/umfpack_make.m @@ -34,20 +34,16 @@ flags = ['-silent ' flags] ; end -v = version ; -try - % ispc does not appear in MATLAB 5.3 - pc = ispc ; - mac = ismac ; -catch - % if ispc fails, assume we are on a Windows PC if it's not unix - pc = ~isunix ; - mac = 0 ; +if (ispc) + % MSVC does not define ssize_t + flags = [flags ' -DNO_SSIZE_T'] ; end +v = version ; + fprintf ('Compiling UMFPACK for MATLAB Version %s\n', v) ; -if (pc) +if (ispc) obj = 'obj' ; else obj = 'o' ; @@ -62,7 +58,7 @@ % This is exceedingly ugly. The MATLAB mex command needs to be told where to % find the LAPACK and BLAS libraries, which is a real portability nightmare. -if (pc) +if (ispc) % BLAS/LAPACK functions have no underscore on Windows flags = [flags ' -DBLAS_NO_UNDERSCORE'] ; if (verLessThan ('matlab', '7.5')) @@ -91,7 +87,7 @@ flags = [flags ' -DBLAS32'] ; end -if (~(pc || mac)) +if (~(ispc || ismac)) % for POSIX timing routine lapack = [lapack ' -lrt'] ; end diff --git a/UMFPACK/Source/umf_analyze.c b/UMFPACK/Source/umf_analyze.c index 8dde3c3709..039c973d3f 100644 --- a/UMFPACK/Source/umf_analyze.c +++ b/UMFPACK/Source/umf_analyze.c @@ -90,7 +90,7 @@ Int UMF_analyze /* ==== initializations ================================================= */ /* ====================================================================== */ -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j < n_col ; j++) { Link [j] = EMPTY ; @@ -577,7 +577,7 @@ Int UMF_analyze k = 0 ; /* Pragma added May 14, 2003. The Intel compiler icl 6.0 (an old * version) incorrectly vectorizes this loop. */ -#pragma novector +UMFPACK_NOVECTOR for (j = 0 ; j < n_col ; j++) { if (Front_npivcol [j] > 0) diff --git a/UMFPACK/Source/umf_assemble.c b/UMFPACK/Source/umf_assemble.c index c6f9fc4b3b..0d5bd122d7 100644 --- a/UMFPACK/Source/umf_assemble.c +++ b/UMFPACK/Source/umf_assemble.c @@ -112,7 +112,7 @@ PRIVATE void row_assemble /* no columns assembled out this Lson yet */ /* -------------------------------------------------- */ -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j < ncols ; j++) { col = Cols [j] ; @@ -132,7 +132,7 @@ PRIVATE void row_assemble /* some columns have been assembled out of this Lson */ /* -------------------------------------------------- */ -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j < ncols ; j++) { col = Cols [j] ; @@ -263,7 +263,7 @@ PRIVATE void col_assemble /* no rows assembled out of this Uson yet */ /* -------------------------------------------------- */ -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrows ; i++) { row = Rows [i] ; @@ -279,7 +279,7 @@ PRIVATE void col_assemble /* some rows have been assembled out of this Uson */ /* -------------------------------------------------- */ -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrows ; i++) { row = Rows [i] ; @@ -639,7 +639,7 @@ void UMF_assemble_fixq /* compute the compressed column offset vector*/ /* [ use Wm [0..nrows-1] for offsets */ -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrows ; i++) { row = Rows [i] ; @@ -660,7 +660,7 @@ void UMF_assemble_fixq Col_degree [col] -= nrowsleft ; #endif Fcol = Fcblock + Fcpos [col] ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrows ; i++) { /* Fcol [Wm [i]] += S [i] ; */ @@ -686,7 +686,7 @@ void UMF_assemble_fixq Col_degree [col] -= nrowsleft ; #endif Fcol = Fcblock + Fcpos [col] ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrows ; i++) { /* Fcol [Wm [i]] += S [i] ; */ @@ -733,7 +733,7 @@ void UMF_assemble_fixq Col_degree [col] -= nrowsleft ; #endif Fcol = Fcblock + Fcpos [col] ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrowsleft ; i++) { /* Fcol [Wm [i]] += S [Woo [i]] ; */ @@ -758,7 +758,7 @@ void UMF_assemble_fixq Col_degree [col] -= nrowsleft ; #endif Fcol = Fcblock + Fcpos [col] ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrowsleft ; i++) { /* Fcol [Wm [i]] += S [Woo [i]] ; */ @@ -817,7 +817,7 @@ void UMF_assemble_fixq /* compute the compressed column offset vector */ /* [ use Wm [0..nrows-1] for offsets */ -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrows ; i++) { row = Rows [i] ; @@ -835,7 +835,7 @@ void UMF_assemble_fixq Col_degree [col] -= nrowsleft ; #endif Fcol = Fcblock + Fcpos [col] ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrows ; i++) { /* Fcol [Wm [i]] += S [i] ; */ @@ -881,7 +881,7 @@ void UMF_assemble_fixq Col_degree [col] -= nrowsleft ; #endif Fcol = Fcblock + Fcpos [col] ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrowsleft ; i++) { /* Fcol [Wm [i]] += S [Woo [i]] ; */ @@ -965,7 +965,7 @@ void UMF_assemble_fixq Col_degree [col] -= nrows_to_assemble ; #endif Fcol = Fcblock + Fcpos [col] ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrows_to_assemble ; i++) { /* Fcol [Wm [i]] += S [Woo [i]] ; */ @@ -992,7 +992,7 @@ void UMF_assemble_fixq Col_degree [col] -= nrows_to_assemble ; #endif Fcol = Fcblock + Fcpos [col] ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < nrows_to_assemble ; i++) { /* Fcol [Wm [i]] += S [Woo [i]] ; */ diff --git a/UMFPACK/Source/umf_blas3_update.c b/UMFPACK/Source/umf_blas3_update.c index 7fdfb710a8..0152409864 100644 --- a/UMFPACK/Source/umf_blas3_update.c +++ b/UMFPACK/Source/umf_blas3_update.c @@ -74,7 +74,7 @@ void UMF_blas3_update Entry *c_ij, *l_is ; c_ij = & C [j*d] ; l_is = & L [0] ; - #pragma ivdep + UMFPACK_IVDEP for (i = 0 ; i < m ; i++) { /* C [i+j*d]-= L [i] * U [j] */ @@ -109,7 +109,7 @@ void UMF_blas3_update Entry *u_ij, *u_sj ; u_ij = & U [i*dc] ; u_sj = & U [s*dc] ; - #pragma ivdep + UMFPACK_IVDEP for (j = 0 ; j < n ; j++) { /* U [i*dc+j] -= LU [i+s*nb] * U [s*dc+j] ; */ @@ -142,7 +142,7 @@ void UMF_blas3_update Entry *c_ij, *l_is ; c_ij = & C [j*d] ; l_is = & L [s*d] ; - #pragma ivdep + UMFPACK_IVDEP for (i = 0 ; i < m ; i++) { /* C [i+j*d]-= L [i+s*d] * U [s*dc+j] */ diff --git a/UMFPACK/Source/umf_create_element.c b/UMFPACK/Source/umf_create_element.c index 59352bf0c2..7b5b242de3 100644 --- a/UMFPACK/Source/umf_create_element.c +++ b/UMFPACK/Source/umf_create_element.c @@ -27,7 +27,7 @@ PRIVATE void copy_column (Int len, Entry *X, Entry *Y) { Int i ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < len ; i++) { Y [i] = X [i] ; @@ -96,7 +96,7 @@ Int UMF_create_element if (!Symbolic->fixQ) { /* but only if the column ordering is not fixed */ -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j < fncols ; j++) { /* add the current frontal matrix to the degree */ @@ -109,7 +109,7 @@ Int UMF_create_element /* add the current frontal matrix to the degrees of each row */ /* ---------------------------------------------------------------------- */ -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < fnrows ; i++) { /* add the current frontal matrix to the degree */ @@ -133,7 +133,7 @@ Int UMF_create_element /* guard against integer overflow. This is very rare */ DEBUG1 (("Integer overflow, cdeg\n")) ; Work->cdeg0 = 1 ; -#pragma ivdep +UMFPACK_IVDEP for (e = 1 ; e <= Work->nel ; e++) { if (E [e]) @@ -154,7 +154,7 @@ Int UMF_create_element /* guard against integer overflow. This is very rare */ DEBUG1 (("Integer overflow, rdeg\n")) ; Work->rdeg0 = 1 ; -#pragma ivdep +UMFPACK_IVDEP for (e = 1 ; e <= Work->nel ; e++) { if (E [e]) @@ -172,7 +172,7 @@ Int UMF_create_element if (!Work->pivrow_in_front) { -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j < fncols ; j++) { Fcpos [Fcols [j]] = EMPTY ; @@ -181,7 +181,7 @@ Int UMF_create_element if (!Work->pivcol_in_front) { -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < fnrows ; i++) { Frpos [Frows [i]] = EMPTY ; @@ -283,12 +283,12 @@ Int UMF_create_element /* copy frontal matrix into the new element */ /* ---------------------------------------------------------------------- */ -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < fnrows ; i++) { Rows [i] = Frows [i] ; } -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < fncols ; i++) { Cols [i] = Fcols [i] ; diff --git a/UMFPACK/Source/umf_extend_front.c b/UMFPACK/Source/umf_extend_front.c index 76ab39e7e8..4d89fd3cb2 100644 --- a/UMFPACK/Source/umf_extend_front.c +++ b/UMFPACK/Source/umf_extend_front.c @@ -31,7 +31,7 @@ PRIVATE void zero_front ( /* zero the new rows in the contribution block: */ F = Fj ; Fj += fnr_curr ; -#pragma ivdep +UMFPACK_IVDEP for (i = fnrows ; i < fnrows_extended ; i++) { /* CLEAR (Fcblock [i + j*fnr_curr]) ; */ @@ -45,7 +45,7 @@ PRIVATE void zero_front ( /* zero the new columns in the contribution block: */ F = Fj ; Fj += fnr_curr ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < fnrows_extended ; i++) { /* CLEAR (Fcblock [i + j*fnr_curr]) ; */ @@ -59,7 +59,7 @@ PRIVATE void zero_front ( /* zero the new rows in L block: */ F = Fj ; Fj += fnr_curr ; -#pragma ivdep +UMFPACK_IVDEP for (i = fnrows ; i < fnrows_extended ; i++) { /* CLEAR (Flblock [i + j*fnr_curr]) ; */ @@ -73,7 +73,7 @@ PRIVATE void zero_front ( /* zero the new columns in U block: */ F = Fi ; Fi += fnc_curr ; -#pragma ivdep +UMFPACK_IVDEP for (j = fncols ; j < fncols_extended ; j++) { /* CLEAR (Fublock [i*fnc_curr + j]) ; */ diff --git a/UMFPACK/Source/umf_internal.h b/UMFPACK/Source/umf_internal.h index a7ee7d0b72..59aeff8cdf 100644 --- a/UMFPACK/Source/umf_internal.h +++ b/UMFPACK/Source/umf_internal.h @@ -162,6 +162,30 @@ #endif #endif +#if defined (HAVE_PRAGMA_GCC_IVDEP) +# define UMFPACK_IVDEP _Pragma("GCC ivdep") +#elif defined (HAVE_PRAGMA_CLANG_LOOP_VECTORIZE) +# define UMFPACK_IVDEP _Pragma("clang loop vectorize(enable)") +#elif defined (HAVE_PRAGMA_IVDEP) +# define UMFPACK_IVDEP _Pragma("ivdep") +#elif defined (HAVE_PRAGMA_LOOP_IVDEP) +# define UMFPACK_IVDEP _Pragma("loop( ivdep )") +#else +# define UMFPACK_IVDEP +#endif + +#if defined (HAVE_PRAGMA_GCC_NOVECTOR) +# define UMFPACK_NOVECTOR _Pragma("GCC novector") +#elif defined (HAVE_PRAGMA_CLANG_LOOP_VECTORIZE) +# define UMFPACK_NOVECTOR _Pragma("clang loop vectorize(disable)") +#elif defined (HAVE_PRAGMA_NOVECTOR) +# define UMFPACK_NOVECTOR _Pragma("novector") +#elif defined (HAVE_PRAGMA_LOOP_NO_VECTOR) +# define UMFPACK_NOVECTOR _Pragma("loop( no_vector )") +#else +# define UMFPACK_NOVECTOR +#endif + /* ------------------------------------------------------------------------- */ /* integer type for AMD: int32_t or int64_t */ /* ------------------------------------------------------------------------- */ diff --git a/UMFPACK/Source/umf_local_search.c b/UMFPACK/Source/umf_local_search.c index c45e5ba7a1..6b180700c4 100644 --- a/UMFPACK/Source/umf_local_search.c +++ b/UMFPACK/Source/umf_local_search.c @@ -482,7 +482,7 @@ Int UMF_local_search for (j = 0 ; j < fnpiv ; j++) { Entry Fuj = Flu [j] ; -#pragma ivdep +UMFPACK_IVDEP for (i = j+1 ; i < fnpiv ; i++) { /* Flu [i] -= Flublock [i + j*nb] * Flu [j] ; */ @@ -523,7 +523,7 @@ Int UMF_local_search Fuj = Flu [j] ; if (IS_NONZERO (Fuj)) { - #pragma ivdep + UMFPACK_IVDEP for (i = 0 ; i < fnrows ; i++) { /* Wy [i] -= Flblock [i+j*fnr_curr] * Fuj ; */ diff --git a/UMFPACK/Source/umf_scale_column.c b/UMFPACK/Source/umf_scale_column.c index 907ea6194a..244526ea32 100644 --- a/UMFPACK/Source/umf_scale_column.c +++ b/UMFPACK/Source/umf_scale_column.c @@ -156,7 +156,7 @@ void UMF_scale_column Entry *Fs, *Fe ; Fs = Fcblock + fspos ; Fe = Fcblock + fncols * fnr_curr ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < fnrows ; i++) { Fs [i] = Fe [i] ; @@ -171,7 +171,7 @@ void UMF_scale_column Entry *Fs, *Fe ; Fs = Fublock + fs ; Fe = Fublock + fncols ; -#pragma ivdep +UMFPACK_IVDEP for (i = 0 ; i < fnpiv ; i++) { Fs [i * fnc_curr] = Fe [i * fnc_curr] ; @@ -231,7 +231,7 @@ void UMF_scale_column Entry *Fd, *Fs ; Fd = Fublock + fnpiv * fnc_curr ; Fs = Fcblock + fspos ; -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j < fncols ; j++) { Fd [j] = Fs [j * fnr_curr] ; @@ -245,7 +245,7 @@ void UMF_scale_column Entry *Fd, *Fs ; Fd = Flublock + fnpiv ; Fs = Flblock + fspos ; -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j <= fnpiv ; j++) { Fd [j * nb] = Fs [j * fnr_curr] ; @@ -257,7 +257,7 @@ void UMF_scale_column Entry *Fd, *Fs ; Fd = Flublock + fnpiv ; Fs = Flblock + fspos ; -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j < fnpiv ; j++) { ASSERT (IS_ZERO (Fs [j * fnr_curr])) ; @@ -300,7 +300,7 @@ void UMF_scale_column Fd = Flublock + fnpiv ; Fs = Flblock + fspos ; Fe = Flblock + fnrows ; -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j <= fnpiv ; j++) { Fd [j * nb] = Fs [j * fnr_curr] ; @@ -314,7 +314,7 @@ void UMF_scale_column Fd = Flublock + fnpiv ; Fs = Flblock + fspos ; Fe = Flblock + fnrows ; -#pragma ivdep +UMFPACK_IVDEP for (j = 0 ; j < fnpiv ; j++) { ASSERT (IS_ZERO (Fs [j * fnr_curr])) ; diff --git a/UMFPACK/Source/umfpack_get_numeric.c b/UMFPACK/Source/umfpack_get_numeric.c index c47e2d9c0c..47fb3a4307 100644 --- a/UMFPACK/Source/umfpack_get_numeric.c +++ b/UMFPACK/Source/umfpack_get_numeric.c @@ -363,13 +363,13 @@ PRIVATE void get_L /* count the nonzeros in each row of L */ /* ---------------------------------------------------------------------- */ -#pragma ivdep +UMFPACK_IVDEP for (row = 0 ; row < n_inner ; row++) { /* include the diagonal entry in the row counts */ Wi [row] = 1 ; } -#pragma ivdep +UMFPACK_IVDEP for (row = n_inner ; row < n_row ; row++) { Wi [row] = 0 ;